32 comments

[ 2.9 ms ] story [ 54.2 ms ] thread
Most people don't run any Python programs on their machines except for OS package managers. Google and others moved to Go, and the Python job market does not reflect these statistics at all.

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?

Yeah brother, down with Big Python!
I work in a chemistry research field. Most people I know run Python programs for their research. No one I know uses Go. I only know a handful who use Java. Rust and Julia are oddities that appear occasionally.

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?

I continue to believe that python is only still popular for the ecosystem effect. Students are taught it, a bunch of libraries were written for it, now everyone keeps using it.

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.

I'm surprised at the negative comments about Python here. Python has been my favorite language since I learned it, and nothing else has come close to it.

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.

There are negative comments about Python every time there's an opportunity presented. There are lots of positive comments too.

The wisecrack goes that Python is the second-best language for everything. I think this is clearly false: it is the best language for soliciting opinionated discussion on a forum.

Because:

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?

Tesla's dashboard is not simple. Having a touchscreen for everything instead of physical buttons is a travesty.
The main reason I don’t like Python very much (besides performance) is that it makes what should be simple tasks complex due to the expression problem, arising from its use of class-based object orientation. You can avoid some of the issues in your own programs (but can’t escape insanity such as ",".join(["a", "b"])), but as soon as you delve into a library of any complexity to make alterations, you’re mired in a morass of methods encased in classes inheriting from other classes, and nothing is straightforward. Discovering Julia, which solves the expression problem¹, was enlightening. Even if it were as slow as Python, I would still prefer it: it is simpler, more beautiful, and more readable.

https://arstechnica.com/science/2020/10/the-unreasonable-eff...

>The dashboard of a Tesla to that of a Volkswagen

Dude!

You think a touch screen tablet replacing all the knobs and tactile buttons is actually a step forward?

Perl 6
I first used Python for anything serious in around 2005. From that moment forward I couldn't fathom ever touching Perl again. This was without even considering what changes were planned for 6 at the time; I knew there was a plan but the base of Perl seemed fundamentally unfixable to me.
I never really took Python seriously, but lately I've been programming almost all of my personal projects in Python. The way I see it: For any kind of project I might take on, Python is never the best language to do it in, but is almost always the second-best language to do it in. This makes it a great default, especially if it's just a little one-off tool or experiment.
I have written a not inconsiderable amount of Python. But the problem I found was that I spent too much time debugging runtime issues and I do not enjoy that. I found that while it took longer to write correct Rust to solve problems I wanted solving, I enjoyed that so it was a better deal.
That's a pretty good way to frame it. The speed of developing to me justifies the "second best" aspect.
Regardless of the reasons why, the fact is python works well enough.

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.

Something like uv has been long, long over due.
I think Python's centrality is a consequence of its original purpose as a language intended for instruction.

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.

Python’s popularity seems to me driven by ML and data science.

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.

I think you got it backwards: Python was used in ML and data science because it was already one of the preferred languages. A single line can do the work of whole functions in other languages, while remaining clear.

Also, the tooling is abundant and of great quality, it made it the logical choice.

I've been working with python professionally for just over a year now and the main difference from having come from a .net background seems to be that tests are far easier to write and more prevalent in our codebase. I'm sure some of that is cultural, but "runtime" errors are quickly found by any reasonable test suite.

That said, it always saddens me that ML (as in oCaml and F#) don't get more love. They basically can hit all the same bases with ease of readability, multi paradigm, module first programming that python can but just never got the same love.

For me, a python user since the late '90s, the answer has always been simple:

Guido has taste.

Maybe one factor is its versatility in leetcode, which to a first approximation every SWE has to do.

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.

My use case is scientific computing and for that Python is excellent thanks to Numpy, IPython and Numba. It's often possible to write code that is nearly as fast as C, but it's far easier to write and debug, since you can just inspect and run code snippets in the shell. In that regard, it's similar to MATLAB, but it's FOSS and faster with the right libraries.
I have written code in Pascal, C, C++, Java, TypeScript, PHP and Python in my life.

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.

(comment deleted)
Python is the new Pascal.

It is probably the first language for 99% of the computer science students who didn't know any programming before college. And even for those who knew programming, chances are that a lot of them have at least dabbled a little with it.

From time to time I am peeking over from VS Code to PyCharm and recently I have been surprised how much it seems to fall behind. No (official) ruff integration, you have to use 'External Tools', which is not part of the backup&sync feature. Seriously?
I've been programming only in Python for a while now. I got a certificate that required digging into the language enough to do the code in your head. I code projects in VS Code. I've enjoyed it, esp library availability.

I do warn people that it's not as easy or intuitive as advertized. I've often been bitten by unexpected errors. I think a survey of these might be worthwhile.

One was typing or conversion errors. Some conversions, like int-to-str in a string concantenation, seem pretty obvious. That isnumeric() didn't consider negative numbers as numbers was a surprise.

Sometimes it's consistency. I've often alternated between lists and sets in applications. I prefer to keep most data as a list but use sets for uniqueness checks or redundancy filtering. Despite being collections, one uses .append() and one uses .add(). Little differences not only add confusion: I have to modify my codebase if mixing or switching them which can become a type error later in another spot.

Another were common operations usually in one place were split across two. That happened with time vs datetime and filesystem operations which might take two modules. I've considered making a wrapper that turns all those into one thing with internal redundancy removed. There might be a reason others haven't done that, though.

Another issue was distribution. I can do straightforward building of console apps for two platforms. That's reliable. If worried about reliable, Python apps seemed easier to deliver as a Flask site than distribute my utilities as standalone. Nikita was really impressive, though, in terms of the work that must have went into it.

In my case, I also missed the ability to easily make linked lists in C to build trees. I wanted to build a C-like tree in Python but it couldnt do self-referential structures IIRC. Since that app requirements were C-like, and performance was no issue, I actually simulated a C-like heap in Python, ported a C tree to it, and build the tool on that. I also got a use-after-free in Python of all things lol. Anyway, I was surprised there was a data structure C could do but a high-level, GC, reflective language couldn't. There might be a trick for this others know about but I figure they just wrap C code for those things.

On the positive side, the debugging experience with Python was so much better than some beginner languages. I'm grateful for the work people put into that. I also love that there are easy to use accelerators, from JIT's to the C++ generator.

I was wanting an acceleratable subset with metaprogramming when Mojo appeared. I might try it for toy problems. I gotta try to stay in idiomatic-ish Python for now, though, since it's for career use.

This is almost certainly LLM generated.

Six flowery “from-to”s in one article:

>from beginners to seasoned professionals

>from seasoned backend engineers to first-time data analysts

>from GPU acceleration and distributed training to model export

>from data preprocessing with pandas and NumPy to model serving via FastAPI

>from individual learners to enterprise teams

>from frontend interfaces to backend logic

And more annoyingly, at least four “not just X, but Y”.

>it doesn’t just serve as a first step; it continues adding value

>that clarity isn’t just beginner-friendly; it also lowers maintenance costs

>the community isn’t just helpful, it’s fast-moving and inclusive

>this network doesn’t just solve problems; it also shapes the language’s evolution

And I won’t mention the em-dashes out of respect to the human em-dash-users…

This stuff is so tiring to read.

My background is in philosophy and formal logic. The idea that python isn’t the #1 language used is insane to me.

Yea, I’m sure there is a lot of technical reasons to use other languages, but with python, you can just read it. I remember buying “learn python the hard way” about 15 year ago, and just looking through the book thinking… wait, I can already read this.

Natural language parallels are huge.