Live data from Hacker News

Ask HN: Why Did Python Win?

news.ycombinator.com

51–60 of 162 posts

Re: Ask HN: Why Did Python Win?

#51
The elegant syntax that is close to plain English sets it apart.

(It’s not so pretty these days though with all these type hints and other cruft that’s been added in the last ten years.)

Re: Ask HN: Why Did Python Win?

#52
I don't know if you can point to a single feature, a lot of what makes a language successful is around context and placement (javascript being a great example of this).

I think there's a few key features for python that have definitely been a big help for it:

It's highly dynamic meaning you can get running with it before understanding every detail (no compile step, no static typing etc).

It may not be the best at everything, but is a decent choice for most things, making a good generic intro language for programming.

It has good interop with low level languages - this is a big deal for data science where a less technical (from a CS perspective) user still needs the performance of a language like C/Fortran/Rust/etc. Python's pattern of "use python as a high level api for libraries in those other languages" (as in numpy, pandas, polars, pytorch etc).

That last one has been a big deal recently, python has become the de-facto language for data science as a result of this.

Re: Ask HN: Why Did Python Win?

#53
IMO, Python rode some of the growth from the data and scientific computing computing. It was lower friction for many people partially due to the amount of blogs, and open source projects that were available. Pandas and Numpy made it quite easy to get up and running with a lot of analytics. pytorch and tensorflow were also there to facilitate this, made people able to get the benefits of the optimized C code but most users did not have to learn C. Eventually FastAPI came out for those looking to build products out of their data, and FastAPI had fantastic documentation and guides, which helped these same folks coming from data/scientific compute build working software. I suppose what I am describing are some of the network effects.

Re: Ask HN: Why Did Python Win?

#54
post #10

Its syntax is lowest common denominator. It’s incredibly easy for people from all walks of life to pick up. It’s “good enough” for just about every task. But really it’s because Google, Dropbox, etc made it so. Same reason Java got popular. It’s hard to beat first class corpo support even if the actual language isn’t that great.

Google certainly had a honeymoon period with Python. They hired Guido to work on some internal apps (IIRC Mondrian?). They released the original App Engine before cloud was a buzzword supporting only Python. But at some point, the default easy-to-learn language at Google became Go, and it happens to be statically typed, preventing a large class of bugs from ever being compiled. There was a manifesto about how Python and all other dynamically typed languages were unsuitable for large-scale software engineering. Only small pieces of code are still using Python.

Re: Ask HN: Why Did Python Win?

#55
post #17
post #6

I think the reason python won was that it was easy to learn and read and was batteries included. vs perl: People need to solve their problems, not fight with syntax Theres a lot of network effects as well. The more people were using it, the more people will use it.

I don't believe the "syntax win" scenario. Python is also ugly, due to the required indentation, like yaml. I believe more in the ecosystem, specifically how the computer vision and machine learning movements have adopted python extensively as frontend language (the heavy weightlifting is still doing in C++). The exploit of numpy has brought many many use cases into the language as well.

"Ugly" is a very opinionated statement there. I personally find it's fine, and Python's required-indentation matches what I'd be doing anyway. It's no different to me than a project which lints indentation via something like gofmt.

Re: Ask HN: Why Did Python Win?

#58
Google used and endorsed it at a critical time back when the mainstream media machine was inflating their image. Even programmers like to ape celebrities and by extension Python was the choice of the sophisticated and well-read hacker in the know. It was just luck and dumb social reasons.

Re: Ask HN: Why Did Python Win?

#60
I learned Python circa 2000 as a 17 year old.

It felt pretty easy to read and write, had minimal surprises, and it made writing simple programs easy. The batteries-includedness was great.

It felt like it was designed by a smart guy for practical programming, rather than by a brilliant academic who was wed to purity for maximum elegance. It accepted some warts, but them in mostly ergonomic places.

It was dictated by people who could relegate map, filter, and reduce from builtins to the library. As much as I personally even liked map in particular (I am not super anti functional programming), it's nice to realize the designer had the taste to prefer longer but more explicit programs.

    ys = [f(x) for x in xs]
    ys = map(f, xs)
As much as I disliked that particular decision, there is no doubt to me that it is just designed for lower cognitive burden when doing simple/common things.

If you show both of those lines of code to a person in cs101 who has studied Java for a couple months but hasn't seen Python, I am pretty sure they are gonna understand the first line way quicker. Mostly consistent decision making like that leads to ergonomic, practical languages. And they win.

It fits in people's brains better. See also, pytorch vs tensorflow.

Post reply on HN