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.
Ask HN: Why did Python win?
621–630 of 856 posts
Re: Ask HN: Why did Python win?
#622At 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?
#623Earlier 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.
Re: Ask HN: Why did Python win?
#624Python happened to be either competitive or dominant in the two biggest niches outside web frontends.
Re: Ask HN: Why did Python win?
#625Earlier 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.
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?
#626Python 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)…
Re: Ask HN: Why did Python win?
#627Re: Ask HN: Why did Python win?
#628Earlier 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…
“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?
#629Re: Ask HN: Why did Python win?
#630Ruby 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.