Live data from Hacker News

Ask HN: Why did Python win?

news.ycombinator.com

621–630 of 856 posts

Re: Ask HN: Why did Python win?

#621

Earlier quoted context omitted.

> just be adequate for a really long time. Seems to be working for Pepsi, and their killer model of "they don't have Coke, is Pepsi okay?"

I'll have the Khao Khalash, thanks.

I'll take a crab juice!

Re: Ask HN: Why did Python win?

#622
I was there when it happened, I remember it well. Python displaced Perl, when Perl was a dominant scripting language, way back in the 1990s. What motivated people to replace Perl with Python is that we started using scripting languages for serious software with non-trivial complexity. In this context, Python was much more scalable and maintainable language than Perl, it was just an easier scripting language for software engineering purposes. I used to write apps in Perl and moved to Python for the same reason everyone else did.

At the time this was happening, neither Ruby nor JavaScript were credible alternatives, Python won by default. The only other scripting language I can remember being used in similar contexts at the time was Tcl.

The other half of it is that Python had a great C binding story, which made it easy to integrate Python with almost everything since C ABI was the lingua franca of interoperability. You could wrap high-performance code in a thin layer that would allow you to efficiently script it in Python. This is why Python became ubiquitous in HPC/supercomputing decades ago. It allowed Python to have a vast library of functionality with good performance and minimal effort by leaning on the vast number of C libraries that already existed to implement that functionality.

Another underappreciated advantage of Python, a bit like C++, is that it is promiscuous language. It isn’t so in love with its purity that it won’t happily do slightly dodgy things to hook up with things that were never intended to work together. It may not be pretty but you can actually make it work and the language doesn’t try to prevent it.

As time went on, a school of thought emerged that you could efficiently do almost anything you needed to do in software engineering with a combination of Python and C++. There is definitely an element of truth to that, and the ease with which you can combine those languages made them common bedfellows in practice.

Python initially won because it was better for writing complex software than Perl, but its staying power was based on its easy integration with literally everything.

Re: Ask HN: Why did Python win?

#623

Earlier quoted context omitted.

I believe what you describe is basically a preference for a language you already know. I'm quite proficient in JavaScript and could repeat everything you say about ... JavaScript. OTOH I had to do things in Python a bunch of times, and it was always very frustrating.

The JavaScript ecosystem is objectively smaller. JavaScript doesn’t have a foothold in data science and ETL, nor deep learning, nor DevOps. There are no decent ORMs in JS, and Python has several. JS is poor for numerical and scientific programming.

[deleted]

Re: Ask HN: Why did Python win?

#624
I think you basically nailed it. Python won because of data science: numpy -> pandas -> pytorch. Django is ~just as good as rails / nodes, but it isn't symmetrical, ruby and javascript don't have the mature data science tooling.

Python happened to be either competitive or dominant in the two biggest niches outside web frontends.

Re: Ask HN: Why did Python win?

#625
post #284

Earlier quoted context omitted.

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

It is a great solution. If you write Python, nobody will mistake it for fast code, it stays where it belongs.

JavaScript for example is much worse, because people are convinced it can be fast for some reason, and keep trying to write nested loops in it.

Re: Ask HN: Why did Python win?

#626

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've used both ruby and python extensively, and I don't actually consider them to be any different, really, on any of these points.

Re: Ask HN: Why did Python win?

#628

Earlier quoted context omitted.

So I imagine you have that perspective because you started less than 20 years ago. In some ways the idea of the Pythonic Way to do things evolved in opposition to Perl's vigorous advocacy of More Than One Way. Python has been really winning for some time, so it's natural that its ideological discipline has grown ragged. The crop of kids who value options above consistency don't have the scars of the Perl age to infor…

Back when I decided it was time to add a scripting language, Perl and Python seemed like the obvious choices, and in my mind were equally good options. I asked my best friend which I should choose, and he more or less said, "You can't go wrong with either one, but when you ask for help Perl people are assholes and Python people are nice." I can't confirm his thoughts on Perl and I haven't interacted much with Ruby, b…

> I haven't interacted much with Ruby

“Matz is nice and so we are nice” https://en.wiktionary.org/wiki/MINASWAN :)

The Rails community is another story, unfortunately.

Re: Ask HN: Why did Python win?

#629
Python was supported by Google, one of the most successful and influential startups in the world. Some good web startups supported ruby on rails but none even close to the size and engineering output of Google. Python was embraced in academia and so became the leader in machine learning also partly influenced by Google putting out and supporting top tier libs like tensorflow. Python was embraced more by hackers than Ruby too and became leader in cybersecurity tools though Ruby has some use still notably with Metasploit. When I was first choosing which language to focus on as a fledgling web hacker it was between Python and Ruby for me too and I like both languages. I chose Python due to Google support which proved to be a good choice at least for job opportunities and good open source libs in the fields I care about.

Re: Ask HN: Why did Python win?

#630
I've worked extensively in production services with both of them. I learned to hate both.

Ruby stupid symbols vs string make code super error prone. Symbolize? Wtf . Also mutable strings are a minefield.

Python semantic spacing is stupid, its bullshit and I've spent crazy amount of time fixing stupid "bugs" that a pair of braces and Ctrl+k F would fix in a second. Also why isnt there a freaking string.length function? Why a len operator? Why not a height operator? Or weight or whatever? Inconsistent.

Their late coming to static typing is soooooo funny . Apparently static typing is not that bad (having had to maintain a huge ruby system would make you WISH it was in some static typed language... even java)

Also isrubyfastyet.com ?

Anyways, both are ok , but I wouldnt build large systems with any if them.

Post reply on HN