Live data from Hacker News

Ask HN: Why did Python win?

news.ycombinator.com

191–200 of 856 posts

Re: Ask HN: Why did Python win?

#191

Python grew out of a myriad of applications that built on hard to replicate components, while Ruby relied only on web development which is remarkably subject to fashion. Python is very simple making it easy to learn. Thus, it became more and more popular for fields where programming is not the main task, like science. It is also very easy to extend with C. So, these fields could bolt on time-tested scientific code in…

> Ruby seemed to be entirely tied to Rails. I’d be interested in going one step further and asking why that was. Rails is great, but so is Ruby, but normally a great library like Rails helps attract developers to the language. Rails is the only example I can think of where a widely popular library (ostensibly) leads to fewer users of the language for other purposes.

I wonder if it's because Rails creates such a specific set of expectations that when you actually try to do something without it you run into problems. "Oh, that's only a rails thing? I thought that was a ruby thing..."

Ruby's monkey patching convention might make this worse.

Re: Ask HN: Why did Python win?

#192

Python was developed in the late 80's and first released in 1991 - it's been around awhile. One of the things that always made it useful before it became so popular is its great interop with C/C++. Ultimately that interop led to NumPy and SciPy, which allowed you to use a rather simple language and yet get high performance when doing calculations. That, as they say, was that. It doesn't hurt that Python is a multi pa…

>Java JIT compilation optimizations that's been applied to Python interpreted code I thought CPython doesn't JIT at all? What optimizations are you referring to

PyPy and IronPython

Re: Ask HN: Why did Python win?

#193

Python ended up 'specializing' in data contexts, thanks to Numpy / Pandas, and as a result, ended up becoming the first exposure to programming than anyone doing data stuff had. That was millions of people. In that space, it had no competitors. Ruby ended up 'specializing' in web dev, because of Rails. But when Node and React came out, Ruby on Rails had to compete with Nodejs + React / MERN as a way of building a web…

I'll argue that python is very alive in the system management/scripting space.

Because of the library support (especially for data) it's also popular as api servers. It's not as popular for entire applications but is still very active.

EDIT: Django is actually about equal or more popular then nodejs based on google trends. Not sure that means anything as idk how many people google "nodejs" when working on it.

Re: Ask HN: Why did Python win?

#194

Python is the scriptiest lang that is mostly understandable from other popular C-based langs like C++, Java, JavaScript. Ruby is too different; too many symbols and idiosyncrasies inherited from Perl, Smalltalk, and created by itself. That is the root reason why they diverged and Python ended up with the scientific ecosystem. This is further evidenced by Ruby’s popularity only shooting up with Rails, when 2005 web 2.…

Lua is actually a much better embeddable language, but it's not as popular and has its quirks.

Re: Ask HN: Why did Python win?

#195
post #48

What exactly did it win? The prize for greatest number of incompatible versions?

I'll bite. 3.x was not that incompatible - I had zero trouble moving to it, because I had handpicked my dependencies throughout the years and the minimal syntax tweaks were exceptionally easy to flag and convert.

Re: Ask HN: Why did Python win?

#196

Earlier quoted context omitted.

I think Python was popular as a general-purpose language first. After all, there was a reason people put so much effort into writing Numpy in the first place. I think a lot of people were attracted to the language design, as captured in the Zen of Python ( https://peps.python.org/pep-0020/ ), such as: Explicit is better than implicit. Readability counts. Errors should never pass silently (unless explicitly silenced)…

> There should be one-- and preferably only one --obvious way to do it. This is so hilariously wrong in python though

Whatever in the NamedTuples do you mean?

Re: Ask HN: Why did Python win?

#197
All imo but in the beginning Python took Perl marketshare for scripting because it was simply less "esoteric". 10 Python programmers wrote similar programs to solve the same task whereas 10xPerl programmers would be more creative. All while coming with "batteries included" which helped to get stuff done quickly. And Python has always played well with C so you could optimize if need be.

At the same time, Python was a pretty early adopter for the server backend (and stuff like Zope existed) and also had great interopt with databases but PHP was a stong contender/#1. I'd say Rails timing was off by a bit or Ruby would have gotten more momentum (at that time there were already many things in Python land to compete like Django etc.). Meanwhile JS was still pretty cludgy to use and required a lot of hoops just to set up an environemnt and things like node came a bit late as well or JS would have taken more "web backend marketshare" from Python immediately. There was a window when the Python 2->3 transition slowed things down (imo) but overall it went slow but smooth for such a big transition.

Python was also an early player in other niches like security (both scripting and tooling).

And when ML happened to take off (grossly simplified) once again Python was there as an early player with good tooling and support for most things and with excellent ties to scientific computing.

It also got good support early from some key players, most noteably Google.

So basically, Python was always there when it mattered and "good enough", came with "batteries included" and the Python community has always been great + willing to quickly get working tooling and libraries in all relevant areas. Importantly Python has always been beginner friendly enough to attract a decent chunk of non programmer specialists from other fields that used it to dive into programming (scientific computing in general but biology comes to mind as a typical use case).

Re: Ask HN: Why did Python win?

#198
post #76

Python ended up 'specializing' in data contexts, thanks to Numpy / Pandas, and as a result, ended up becoming the first exposure to programming than anyone doing data stuff had. That was millions of people. In that space, it had no competitors. Ruby ended up 'specializing' in web dev, because of Rails. But when Node and React came out, Ruby on Rails had to compete with Nodejs + React / MERN as a way of building a web…

Numpy is certainly amazing, but there are tons of competitors in the data/scientific space, which pure "A-type" data scientists tend to prefer: R, SSPS, Matlab... The difference is that Python doesn't entirely suck as a general-purpose language. Sure, you might have better options, but it's still reasonable to write almost anything in Python. Other scripting languages like Ruby, JS and Lua are probably a little bit b…

Some industries are stuck on matlab (jet propulsion, for example) but in general people from sciences are either Python or R, and SAS/SPSS are only really used in places like health care or pharma where there's a lot of regulation in place, because the software is designed around that regulation, unlike Python and R.

Re: Ask HN: Why did Python win?

#199

Earlier quoted context omitted.

In my experience, Perl got a lot of flak for being "write only", I don't really remember anybody complaining it wasn't "object oriented". Every Perl code base I've seen, or inherited, has been a mess. My favourite was a bunch of utilities all written by the same person who never did anything the same way twice. Each utility was like an entry in an obfuscated 'C' contest. I used Perl to build my first web application…

There was definitely a group of people who thought "object oriented" was the One True Way and any languages that don't support it are "toys." I'm not sure I ever heard their ire directed at Perl specifically, but I recall the sentiment existing.

Oh definitely the attitude exists. I just never saw it directed at Perl. Maybe since, in my experience, Perl has mostly be used as a system language and not a application development language.

Re: Ask HN: Why did Python win?

#200

Earlier quoted context omitted.

Only one of the items in your "such as" list is unique to python's philosophy, and that is "there should be one way to do it". Ruby embraces the many ways to accomplish something, it's true. However, the three others are not unique to python. Ruby especially embraces "readability counts". And I can't think of anything in the ruby language itself that is implicit over explicit. Perhaps you are thinking of rails and co…

For me, the Ruby community's comfort with monkey patching was a big turn off. In Python, you can hack around on class and replace its methods, but if you do, it's expected that your coworkers might stick you in a dunk tank and sell tickets. It's just not the thing that's done.

I figure if Django built an entire framework around metaprogramming, I'm going to do it to Django model objects as a form of vengeance.
Post reply on HN