Live data from Hacker News

Ask HN: Why did Python win?

news.ycombinator.com

331–340 of 856 posts

Re: Ask HN: Why did Python win?

#331

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…

This comment was very helpful.

Part of my question is why Python was used as a successor to Perl and not Ruby, but it sounds like Python was established as a competitive scripting language 5 years before people were talking about Ruby.

I can’t find it now, but there was another comment that pointed out that the languages weren’t contemporaries.

Re: Ask HN: Why did Python win?

#332

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

I think this is it. Love Ruby as a language. Have grown to hate the way Ruby developers write stuff. Stuff ends up with so much abstraction and indirection. End up yearning for a simpler time when you could write code that just did what you needed it to.

Re: Ask HN: Why did Python win?

#333
post #66

There's a joke that is roughly "Python is not the best language for any particular task, but is nearly always the second best language for that task" - it's a jack of all trades language. Because of this, lots of people learned Python, and then applied it in many different areas, and it just became more prevalent and useful.

> Python is not the best language for any particular task, but is nearly always the second best language for that task

The "second best language" is false, it's just usable for a wide variety of tasks. Just like many other languages, but specifically not Ruby.

Re: Ask HN: Why did Python win?

#334
post #314

Earlier quoted context omitted.

>I think Python was popular as a general-purpose language first. What were their choices though, Perl? It's easy to see why Perl lost out. Other than PHP, I don't really know of any other JIT scripting languages they could have chosen.

You arbitrarily restricted the scope. Java is what I saw. I was in college 2006 - 2010 in CS, and while all the introductory courses were in Java, by 2008 or so a lot of the other students had switched to Python on their own, for projects where either language would work. Didn't really see anything else, just Java and Python.

No, it wasn't arbitrary. A JIT language is much easier to pick up than something needing a compiler and an executable. The focus on a scripting language was deliberate

Edit: turns out the term I'm looking for wasn't JIT but an interpreted language.

Re: Ask HN: Why did Python win?

#335

Earlier quoted context omitted.

I'll bite on "just a fad in webdev circles", in case you are serious and not trolling. Railsworld is celebrating the 20th anniversary of Rails this year. As I'm sure you know, Rails is built on Ruby. 20 years does not fit my definition of fad.

I don't think moonchrome was disparaging Rails or minimizing its popularity, but, rather pointing out that Ruby is only as popular as it is because of webdev, because of Rails (and the Rails-likes that came after)—outside of that specific niche, it's not very commonly used just about anywhere else, especially when compared to Python.

Chef and puppet are fairly big ones though. Other than config management, I think this is true. Rails is king in ruby land.

Re: Ask HN: Why did Python win?

#337

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

Wikipedia suggests that Python debuted in 1991, with Ruby following in 1995.

Re: Ask HN: Why did Python win?

#338
post #297

Earlier quoted context omitted.

JIT may not be the correct thing to call it. At least in my head, any script that doesn't need to be compiled by the dev or the user before running is JIT. It's the scripting vs building difference to me. If that's not correct, then I'd love to be corrected. Here's my reference: https://en.wikipedia.org/wiki/Just-in-time_compilation

Interpreter vs. Compiler might be closer to the distinction you are looking for: https://en.wikipedia.org/wiki/Interpreter_(computing)

Thanks. "My interpreter doesn't care about white spaces, why should I" being something that should have clued me in.

Re: Ask HN: Why did Python win?

#339

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

I remember entering in Python because you have slices and other syntax sugar stuff that makenyou think other programming languages were making you life miserable on purpose!

Also, the batteries included in the standard libs was incredible when you needed to use the ACE/TAO monster in C++.

Finally, interfacing with native code via SWIG enables you to quickly use critical optimized code.

Obviously, other programming languages captured Python power since then.

Re: Ask HN: Why did Python win?

#340
post #284
post #66

There's a joke that is roughly "Python is not the best language for any particular task, but is nearly always the second best language for that task" - it's a jack of all trades language. Because of this, lots of people learned Python, and then applied it in many different areas, and it just became more prevalent and useful.

> Python is not the best language for any particular task Python basically solved this problem by wrapping around C code that's far more performant, but still exceptionally simple to leverage due to python's simple syntax. LlamaCpp has C++ in its name, yet its most popular platform is python. So for certain applications, python because the undisputed #1. Because it was C in disguise, with better usability. With paral…

> Python basically solved this problem by wrapping around C code

I would rather call it a work-around. Having to switch to a vastly different language to get halfway decent performance is hardly a good solution.

It's not a rare thing in normal applications that you need to have some routine fast and there's no pre-built C solution for it.

Post reply on HN