But its syntactically weak? Python itself is slow? pip is awful (although uv is pretty good). Sometimes I am forced to write python because the packages I need are written for it but I always hate it.
AFAIK, it's the preferred language for lots of leetcode, e.g. Advent of Code. The practical expressivity and speed of dev is strong.
It drives me crazy how everything just... blocks. Parallelization is a disaster.
I won't comment much on indentation. All the string formatting syntaxes is crazy. Private names managed by `_`. The type system still mostly sucks. Ect ect.
In my experience it is alright to write short scripts but complexity very quickly balloons and python projects are very often unwieldy.
I would write a script in python, but only if I was positive I would never need to run or edit it again. Which is very rarely the case.
I too would prefer let. But the number of times what you mentioned has bitten me in almost 20 years of programming Python can be counted on in one hand. And these days, just use the "rename" feature in your IDE!
JavaScript has gotten drastically better, especially since ES6. The lack of venvs alone is such a breath of fresh air. The baseline typing sucks more than python, but typescript is so much better. It still suffers from legacy but the world has mostly moved on and I don't see beginners learning legacy stuff much anymore. Modern javascript is amazing. I do my work in Elysia, Kysely (holy crap the python database situation is awful) and everything just works and catches tons of errors.
I don't like Python for "applications" as much. I was at a place almost 10 years ago now that had Python "microservices" running in Kubernetes. managing performance and dependencies for Python in production is just unnecessarily futile compared to something like Go that's also very accessible syntactically.
This is revisionism.
When I was in school, that's what people would say about C/C++/Java.
People like me switched to Python well before it became common to teach it at school. Lots of great libraries were written in it before then as well. I mean, it's really easy to write a library in it than it was in most other languages.
It was picked for teaching in schools because it was a decent language, and was already widespread. It's much more useful to teach Python to an average engineering student than C/C++/Java.
It became popular because it was easy to learn, and a lot nicer to use than the other big scripting language: Perl. When I was in grad school, I would routinely find non-engineers and non-programmers using it for their work, as well as writing libraries for their peers. There is no way they would have done that in any of the prevailing languages of the time - many of them learned to program while in grad school. It became quite popular amongst linguists. Then NumPy/SciPy became a popular alternative to MATLAB, and once again my peers, who would never write C++ to do their work, were suddenly getting matching speed by using Python. That's how it ended up being the language for ML.
So no - the fact that it's taught in schools is not the reason it's used today.
Sure, and this is my argument. It is easy to start out with, which makes it appealing to academics without a CS background. But is this a good thing? Because then these academics without a CS background write monstrous, poorly optimized scripts compounded by a slow language, then use drastically more compute to run their science, and then at the end publish their paper and the scripts they used are very hard to adapt to further research because very rarely are they structured as modules.
Just because it is easy to write doesn't mean it is the most appropriate for science. It is not commonly acceptable to publish papers without a standardized format and other conventions. Students put in work to learn how to do it properly. The same should be true for code.
Slow is relative. You need to account for the time to write as well, and amortize over the number of times the code is run. For code that is run once, writing time dominates. Writing a Java equivalent of half of the things you can do in Python would be a nightmare.
where "run once" in the sense you describe is really the case has been rare for me. Often these one off scripts need to process data, which involves a loop, and all of the sudden, even if the script is only executed once, it must loop a million times and all of the sudden it is actually really slow and then I must go back and either beat the program into shape (time consuming) or let it execute over days. A third option is rewriting in a different language, and when I choose to do a 1:1 rewrite the time is often comparable to optimizing python, and the code runs faster than even the optimized python would've. Plus, these "one off" scripts often do get rerun, e.g. if more data is acquired.
Java is a sort of selective example. I find JavaScript similarly fast to write and it runs much faster.
I'm currently on pure JS project (node and vue) and I'm constantly fighting with things that would be trivial in python or django. Also getting into .NET world and not impressed with that at all.
I know folks like Go, but in decades of being a software consultant I've come across zero companies using it or hiring for it.
1: Simple is better than complex.
2: Beautiful is better than ugly.
3: Readability counts.
Winners across many markets seem to get the importance of simplicity. Compare the Google homepage to the Bing homepage. The dashboard of a Tesla to that of a Volkswagen. Remember how hardcore lean Facebook's UI was compared to MySpace?
I've been writing python from the last century and this year is the first time I'm writing production quality python code, everything up to this point has been first cut prototypes or utility scripts.
The real reason why it has stuck to me while others came and went is because of the REPL-first attitude.
A question like
>>> 0.2 + 0.1 > 0.3
True
is much harder to demonstrate in other languages.The REPL isn't just for the code you typed out, it does allow you to import and run your lib functions locally to verify a question you have.
It is not without its craziness with decorators, fancy inheritance[1] or operator precedence[2], but you don't have to use it if you don't want to.
[1] - __subclasshook__ is crazy, right?
[2] - you can abuse __ror__ like this https://notmysock.org/blog/hacks/pypes
Welcome to Rakudo™ v2025.06.1.
Implementing the Raku® Programming Language v6.d.
Built on MoarVM version 2025.06.
To exit type 'exit' or '^D'
[0] > 0.1 + 0.2 > 0.3
False
https://docs.python.org/3/tutorial/floatingpoint.html#floati...
Even if it's less secure, the beauty of Go, a single, static binary impervious to version changes, is very appealing for small projects you don't want to keep returning to for housekeeping.
There are many things I wish python, or a language like python, could improve on. Yet despite all my wishes, and choosing Rust/Go more often recently, Python still works.
I’m in a love/hate relationship with python. I think it’s becoming more of acceptance now haha.
Yeah, some of its design decisions required immense cost and time to overcome to make for viable production solutions. However as it turns out, however suboptimal it is a language, this is quite made up by the presence of a huge workforce that's decently qualified to wield it.
https://docs.python.org/3/faq/general.html#why-was-python-cr...
""I was working in the Amoeba distributed operating system group at CWI. We needed a better way to do system administration than by writing either C programs or Bourne shell scripts, since Amoeba had its own system call interface which wasn't easily accessible from the Bourne shell. My experience with error handling in Amoeba made me acutely aware of the importance of exceptions as a programming language feature.
It occurred to me that a scripting language with a syntax like ABC but with access to the Amoeba system calls would fill the need."""
Personally, I can’t take seriously any language without a good type system and, no, optional type hints don’t count. Such a type system should express nullability and collection parameterization (ie genetics).
I simply won’t write a lot of code in any language where a typo or misspelling is a runtime error.
Also, the tooling is abundant and of great quality, it made it the logical choice.
Guido has taste.
At least we don't have to use it.
Declare sets, lists, and maps in one line. Don’t need to worry about overflow or underflow. Slicing is extremely convenient and expressive. Types not necessary, but that’s rarely confusing in short code blocks.
Compare to js, you’re immediately dealing with var/let/const decisions using up unnecessary mental energy.
Of this entire pack, Python seems to have the widest ecosystem of libraries. I don't think I ever ran into a "have to reinvent the wheel" problem.
Need to run four test operations in parallel? asyncio.gather(). Need to run something every five minutes? schedule.every(). In most cases, it is a one-liner, or at most two-liner, no sophisticated setup necessary, and your actual business logic isn't diluted by tons of technical code.
Performance-critical parts can be always programmed in C and invoked from the Python code proper.
bgwalter•1h ago
Python is well marketed, with dissenting voices silenced, de-platformed and defamed with PSF involvement. That way many users think the Python ruling class are nice people. It is therefore popular among scientists (who buy expensive training courses) and students (who are force fed Python at university).
It has a good C-API, which is the main reason for its popularity in machine learning. Fortunately for Python, other languages do not take note and insist on FFIs etc.
EDIT: The downvotes are ironic given that Python needs to be marketed every three day here with a a statistic to retain its popularity. If it is so popular, why the booster articles?
ASalazarMX•19m ago
dalke•6m ago
Sure, we have very different experiences. But that also means that unless you can present strong survey data, it's hard to know if your "Most people" is limited to the people you associate with, or is something more broadly true.
The PSF overlap with my field is essentially zero. I mean, I was that overlap, but I stopped being involved with the PSF about 8 years ago when my youngest was born and I had no free time or money. In the meanwhile, meaningful PSF involvement became less something a hobbyist project and something more corporatized .. and corporate friendly.
> scientists (who buy expensive training courses)
ROFL!! What scientists are paying for expensive training courses?!
I tried selling training courses to computational chemists. It wasn't worth the time needed to develop and maintain the materials. The people who attended the courses liked them, but the general attitude is "I spent 5 years studying <OBSCURE TOPIC> for my PhD, I can figure out Python on my own."
> who are force fed Python at university
shrug I was force fed Pascal, and have no idea if Wirth was a nice person.
> main reason for its popularity in machine learning
I started using Python in the 1990s both because of the language and because of the ease of writing C extensions, including reference counting gc, since the C libraries I used had hidden data dependencies that simple FFI couldn't handle.
I still use the C API -- direct, through Cython, and through FFI -- and I don't do machine learning.
> If it is so popular, why the booster articles?
It's an article about a company which sells a Python IDE. They do it to boost their own product.
With so many people clearly using Python, why would they spend time boosting something else?