Things I like about Python
forrestthewoods.com
forrestthewoods.com
It seems like everybody hate significant white-space, but I think it's only an annoyance with good editor support (god help you if you are stuck on nano in a remote session).
If you like C syntax more than Python like me, go immediately becomes a great substitute. I'd also say Typescript but npm nearly matches pip in terms of annoyance sometimes. Deno is cool though, definitely needs a mention!
Machine learning? Best of luck to you! If there's someone working with go/ts in ML field, would love to hear more!
We all do.
- minimalist syntax
- very gentle learning curve
- yet an extremely powerful language
- interactive development
- and of course the library ecosystem
Things I mildly dislike about python but at the end of the day are not a big deal:
- dynamic typing
- significant whitespace
- scoping rules
- dependencies
Things I really hate about python:
- error messages (I *genuinely* find it easier and more pleasant to debug 1000 lines long template metaprogramming backtraces in C++)
- horrible performance
If you’re having trouble I suggest showing leading whitespace in the editor with a very low contrast grey highlight color. Ended all issues for me a decade or two ago. Indentation guides help any language as well. Simple editors like Geany can handle it well.
Unfortunately, Python has gone backwards with the adding of colons everywhere. Pseudocode aspect has sadly been lost imho.
https://docs.python.org/3/whatsnew/3.10.html#better-error-me...
If I'm not mistaken Python was one of the first main-ish programming languages which made list comprehensions a thing, imo there's nothing wrong with their syntax. kwargs are also pretty cool.
(Python programmer for around 15 years)
It create a barrier to innovation because your main language is not the one doing the heavy lifting.
There was an effort to use Swift to create the next ML language with Swift4TensorFlow but it was shelved in february 2021.
The author has the same weird logic that Python wouldn't be as popular without Numpy... but it does have Numpy... Usain Bolt wouldn't be as fast if he didn't have legs too.
Let’s say you have small amount of data, 1Go than can easily fit in the memory of a laptop.
You try to load or do analysis of that with python. The only way to make it work is to use a library that is build in C. Forget doing for loop over that thing. So each library has to build a language of parameters to allow you to use the speed and memory efficiency of C. Effectively in ML python act as a config language for C.
So all the actual work has to happen in C, but all your experiment are in python. That create a barrier to innovation as you hit limit of performance on python and you have to switch language.
But yeah, all the library are in Python and most of the work is still done there so it’s very hard for people to move to something else because they would have to rebuild a huge part of the stack, there is a strong network effect here.
But the core language is still very bad for performance computing.
First off, this thing is just a (click/flame)bait post. Bulleted list with zero explanations. That said, no language is perfect and I can agree with some of it. Addressing points I disagree with the most:
- Startup time: Given that this is a self-professed C(++/#) programmer, _of course_ Python will be slower than a compiled language. This is just a compiled language fan not liking a "not compiled" language, and has nothing to do with Python itself.
- Import system: Having historically used/dabbled with about a dozen+ languages, I have yet to find an import system I like, including the C family of languages.
- Toxic runtime environment: Ignoring the strange use of the word "toxic", without ANY detail whatsoever on what they mean by this, this is pretty useless criticism.
- Error handling / Exceptions: Not sure what he's comparing to. 90% of languages do bad error handling; even the newer ones like Rust/Go/Elm that try to do this well have their own faults and most people ignore them. Also, given that it's a C-family programmer stating this... Python does exceptions basically the same as the C-family, so yeah I guess he hates his favorite languages too?
- kwargs: Without any context, this is a meaningless complaint. Care to elaborate? No? Moving on then.
- List Comprehension syntax: This one is baffling to me. I guess someone who is used to C#'s Linq might find this a bit harder to grasp, but as someone who has used both professionally it's really not that bad, and this syntax is one of the things most people love about Python.
- Globals: Yes, we hate them too. _That's why nobody in their right mind uses them_
- Variable scope: IMO python variable scoping isn't that bad -- maybe a few warts, but I've never had significant problem with it.
- Significant whitespace: I mean....how? Yes it has whitespace-based blocks, but...it's not actually MORE whitespace than a {}-based language... What does "significant" mean here...?
- Standard library: You mean one of the best things about Python? That I don't need 60 billion dependencies on my project to be able to the most basic shit? Now you're just being ridiculous. Also, coming from a C# dev? C'mon man.
- Dependency management: Needs more context. requirements.txt isn't the best choice, but Poetry makes things much more standardized, and very easy to manage -- no different than many other dependency managers.
- Environment variables: ....What? What about them? This isn't a Python thing. Do you dislike how it handles them (as a hashmap)? Do you dislike the environment variables used by the Python runtime? ELABORATE.
- Jupyter Notebooks: Well given that this is not only 100% external to Python, but also completely a voluntary and (AFAIK) not "industry standard for all Python devs" tool, it's like calling C a shitty language because of Arduino.
TLDR: Congrats you googled all the things someone could possibly hate about a language and posted them in a bulleted list without context and called it a "rant"
Also:
> Criticism and nitpicks aren't wrong, but miss the point. Truthiness > Truth
Oh okay, so you never once intended to listen to anyone. Might as well publish these posts to /dev/null
I believe that the author means that the white space itself is significant as a part of the syntax... which it shouldn't be.
from __future__ import braces
Meaning that there is significance to whitespace, as opposed to C where you could cram it all onto one line if you wanted. To put it another way, C doesn't care how you indent, if you even do it at all. Python cares, and will not run your program if you get the whitespace wrong.
Whereas I think you read it as "there's lots of whitespace in Python", which is not what was intended.
Python became the glue language for ML, but that was never it’s intended target and I think that we see more and more than we need something else to go forward.
For me, Python has been one of the better ones. I especially like that its explicit where a symbol comes (unlike C/C++, C#, Ruby) from unless you explicitly opt-out (D is confusing about this).
My main gripe (assuming visibility of items isn't import related) is that it merges pulling symbols in from a module with loading a module, leading to initialization order confusion and several gotches that confuse people.