I actually wish there was something that struck more of a balance between these two philosophies. Ruby’s expressiveness is very nice but unless used carefully, can obscure what’s happening. Python’s clarity in implementation can make a piece of code clear in isolation but can get clunky.
Ask HN: Why did Python win?
721–730 of 856 posts
Re: Ask HN: Why did Python win?
#722Earlier quoted context omitted.
> I haven't seen anything an "A-type" data scientist needs in R/SAS/SPSS that was intrinsic to the language Not intrinsic to the language but in terms of the ecosystem, for a purely A-type data science workload R is significantly better. dplyr + ggplot vs. pandas + matplotlib isn't even remotely close. Now, obviously in the real world nothing is ever purely model work, which is why Python more than makes up for the d…
If there is anything in R that is better, it could be ported. It's kind of different from language intrinsics that can't be easily ported. In fact I think there's a great argument for writing a standardized data processing and visual representation layer in C++, and then making it usable from all the languages. It would be nice if this was true for the notebook layer.
Don't get me wrong, I know mostly write Python because it's a better general purpose language but there are big big tradeoffs.
Re: Ask HN: Why did Python win?
#723Python 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 agree with these as major points. A few other secondary ones Ruby was primarily maintained in Japanese, so had a barrier to entry for language level issues. It also lacked english-language evangelists and university presence. When Ruby was new (invented 1995) Python had some older design issues (as it was 6 years older) however it really recovered and implemented a lot of change through Python 2 (2000) and python 3…
It's at odds with humanity, TBH.
I once spent like two days trying to figure out how a small (couple hundred lines) ruby script worked, because it overrided `method_missing`.
Re: Ask HN: Why did Python win?
#724Earlier quoted context omitted.
I see what you mean, but I counter with Plone. It's been around for 24 years, and the annual Plone Conference is coming up in a couple months. Still, you don't see a whole lot of new Plone sites rolling out these days, and there's no Automattic-scale company with click-here-to-deploy convenience. Nothing against Plone (although I was very happy to put its foundation layer, Zope, in my rear view mirror). It's a fine p…
Plone never had anything even resembling Rails' popularity.
Check out the charts from Google Trends some time.
Re: Ask HN: Why did Python win?
#725Python 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)…
The reason why one language is more used then others at any given times it's way simpler and more bound to humans than the languages them self: - fashion trendes - laziness - sloth
Most of the people out there writing code and "increasing numbers for any given language" have no real idea of why they started with one language rather then some other one, they never really dig deep enough to actually made an informed choice, and most will keep using a single programming language because they "don't feel the need to learn a new one", aka: I'm too lazy to ever go deep enough the only language I know, let alone learning a new one. And it's the market's fault: we spent the last decade or more taunting how many bagilions programmers will be needed, how anyone can get a great life by simply learning a bit how to code, etc. None gave a fuck about quality, the only goal being cheapening and cheapening the Software Developer profession, until neural networks came about and indirectly revealed the truth: we haven't being rising SW developers/engineers/etc, most of them were just Code Typist copying out of stack overflow. If something like copilot or chatGPT can substitute them, it means there wasn't much value there in the 1st place. In 2007, Jeff Atwood made the quote that was popularly referred to as Atwood's Law: “Any application that can be written in JavaScript, will eventually be written in JavaScript.”, and that's NOT a good thing, it's just the epitome of the state of the industry.
In python's case it's luck was google: python (like go, for instance) is a convenient language for system automations, let's say a more sane versions of what perl was mostly used for in the past (if you notice, lots of python Zen's ideas are attempts to fix perl's insanity). Google has lots of system engineering going on, lots of people using (and abusing) python, and a single repo where everything ends up into, and when they started making neural networks with them, python got fashion for making neural networks. Anyone and their dog wanting to try out some kind of machine learning (10+ years ago) would find a tutorial in python, and tensorflow sealed the deal.
Yes, numpy and pandas did have quite a bit of weight into luring the Math Community into using python, but there's nothing inherent in python that makes them possible, they could have being made in any other language. For instance haskel and lisp are way more approachable from a math stand point, they're just not in fashion any more
Re: Ask HN: Why did Python win?
#726Earlier 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.
Perl's actually excellent at processing unstructured data, and it had a strong foothold in bioinformatics for a time. I don't think the decision was as obvious as it looks.
Re: Ask HN: Why did Python win?
#727Earlier quoted context omitted.
Ruby has implicit imports which pollute namespaces. This is extremely annoying for anyone who wants to learn the language. It uses extensive monkey patching, which is once again a substantial challenge for a beginner that wants to understand what their code is doing. It has a nicer syntax with procs and lambdas but syntactically distinguishes between them with different ways of invoking functions and all the issues a…
I don't think either of those issues, namespaces and monkey patching, are things that make the language harder to learn. You require a file, the file's namespaces are available. How often do libraries modify your runtime with monkey patches in a way that you'd notice? I'm sure it's come up during my career, but not when I was a beginner. There was a period of time when metaprogramming was more popular in the ruby and…
So, if you copy that code snippet and run it as an independent script, it would just not work because it was a RoR monkey patch method.
Worse, the implicit imports mean that unless you have a global view of which files and gems are require-d, you don't know what your code is actually going to do.
That, and coworkers suddenly feeling at liberty to override `method_missing`, abusing `bindings`, and all that stuff, makes it really hard to like the language if only for its tendency to bring out the worst in people.
Re: Ask HN: Why did Python win?
#728Earlier 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…
I think Python has some of the worst API documentation I’ve ever read. Even Java puts it to shame and that is sad
Re: Ask HN: Why did Python win?
#729Python 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)…
what general purpose? that's just a buzz word. especially back then shipping python apps was never a viable option compared to binaries compiled from c/++ or java. there never was such a "general purpose".