Live data from Hacker News

Ask HN: Why did Python win?

news.ycombinator.com

431–440 of 856 posts

Re: Ask HN: Why did Python win?

#432

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 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.

There’s not even one obvious flavour of Python to use.

Re: Ask HN: Why did Python win?

#433
post #414

Earlier quoted context omitted.

+1 for mentioning that python's original competitor was Perl. This point is forgotten some 20-30 years latter

Not just perl, but C/C++/Java as well. Ruby was a competitor to Java JSP development back in the day. And I remember when a lot of Java people jumped ship to Ruby. I moved from C++ to python over a decade ago and never looked back. Back then, the python jobs were scarce -- but based upon how I picked up the language, many of the typical C++ issues just disappeared -- and I knew it was going to become popular. One com…

MIT dropping SICP/Scheme for Python conicided with the general decline of education as an end in itself. Python is the VHS of computer languages. I couldn't believe it when I heard MIT dropped a language renowned for its elegant lambda implemenation in favour of a language in which lambdas were not only frowned upon but literally throttled. I think it says everything that MIT ditched Scheme and SICP at the same time as it would be near impossible to teach SICP with Python.

Re: Ask HN: Why did Python win?

#434

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)…

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…

> Ruby embraces the many ways to accomplish something, it's true.

Far less true than with Perl.

In another hand, many questions I asked about Python came with various way to do the stuff. So I'm not sure about that advertisement.

Re: Ask HN: Why did Python win?

#435
post #76

Earlier quoted context omitted.

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.

It is also still quite dominant in neuroscientific fields, as there is a lot of software and code there from the past, but it is changing little by little.

Re: Ask HN: Why did Python win?

#436
I started using reddit in 2006, so I remember a lot of the Ruby vs. Python battle from around that time. Here are a few points that were often raised back then (and which I haven't seen raised here):

- The common wisdom back then was that Python was attracting mostly C programmers who were looking for a faster way to write C and to interface with it, while Ruby was attracting mostly Java programmers who were tired of writing FactoryFactoryFactory classes. As a result, the Python community had a lot more C programmers who were able to work on the lower-level parts of Python (such as the VM and native libraries, like Numpy).

- The original Ruby interpreter (MRI) was very, very slow. It was replaced by YARV when Ruby 1.9 was released. YARV was a bytecode interpreter, while MRI, if I recall correctly, didn't even use bytecode. It just did the parsing while it was executing code. Before the switch to YARV, I remember regularly seeing Ruby at the bottom of the programming language benchmarks page, and it took something like 100x-150x longer than C for a task. Python was about 5x as fast as Ruby back then, IIRC.

- Aside from speed, the Ruby VM had a lot of other problems. The Python VM was rock-solid in comparison. See the links below for more info.

- The Ruby community back then had a reputation for being... unruly, let's say. Some characters there. It also suffered from that sort of chronic beginner syndrome that appears in isolated programming communities. I remember one guy in particular who was fond of justifying Ruby's weaknesses in odd ways. (For example, he said that Ruby doesn't need a debugger because it makes coding so easy that you'll never need one! In reality, Ruby didn't have a debugger because no one felt like making one.)

Here is a blog post talking about issues with the Ruby VM: https://web.archive.org/web/20100606205042/http://cbcg.net/2... (I never forgot that title, haha)

and the discussion on reddit: https://old.reddit.com/r/programming/comments/1kg8e/python_u...

Re: Ask HN: Why did Python win?

#438

> My impression is that in the ‘00s, Python and Ruby were both relatively new, dynamically typed, Your impression is wrong. Python goes back to 1988. It was known in FOSS circles in the 90's: a minority within a minority. The rise of the web exposed more programmers to FOSS, due to pretty much everyone in web eventually having to work with GNU/Linux servers. More developers than ever were suddenly exposed to cruft th…

Python, like Perl before it, also had some very well written books that were very accessible if you were interested in the language. Learning Python and Programming Python first came out in the 90s and then Dive Into Python was released in 2000. I think these really helped with Python's momentum when FOSS platforms were also building momentum and being taken seriously.

Re: Ask HN: Why did Python win?

#439

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. There’s not even one obvious flavour of Python to use.

It's hard for me to name a problem domain that doesn't have 3 different python packages doing the same thing three different ways, each more clever and less understandable than the last.

Re: Ask HN: Why did Python win?

#440

The way I (somewhat hazily) remember it, Python was mainly competing with Perl as a scripting language, not Ruby as an application/web language. I started hearing about Ruby years later when Ruby on Rails drove the Web 2.0 movement, but that feels like a different era to me. Eric S. Raymond wrote an article[1] in 2000 about his experience trying Python after spending a lot of time with Perl. I'll quote some of it her…

> When you're writing working code nearly as fast as you can type and your misstep rate is near zero, it generally means you've achieved mastery of the language. But that didn't make sense, because it was still day one and I was regularly pausing to look up new language and library features!

This really jives with my experience. I learned Ruby first and used it as my scripting language of choice for years, but I constantly found myself having to lookup how to do even the most basic tasks.

A day or two after learning Python I was already as productive as I had been with Ruby, it was wild.

This isn't so much a jab at Ruby, just that Python worked the way I thought a programming language should, which made everything easy.

Post reply on HN