HACKER Q&A
📣 MatthiasPortzel

Why Did Python Win?


I started programming in ~2013 in JavaScript. I’ve since learned and tried a handful of languages, including Python, but JavaScript was always my favorite. Just within the last year I learned Ruby, and I was blown away by how fun and easy to use it is. At the present time, I’m starting all my new projects in Ruby.

My impression is that in the ‘00s, Python and Ruby were both relatively new, dynamically typed, “English-like” languages. And for a while these languages had similar popularity.

Now Ruby is still very much alive; there are plenty of Rails jobs available and exciting things happening with Ruby itself. But Python has become a titan in the last ten years. It has continued to grow exponentially and Ruby has not.

I can guess as to why (Python’s math libraries, numpy and pandas make it appealing to academics; Python is simpler and possibly easier to learn; Rails was so popular that it was synonymous with Ruby) but I wasn’t paying attention at that time. So I’m interested in hearing from some of the older programmers about why Ruby has stalled out and Python has become possibly the most popular programming language (when, in my opinion, Ruby is the better language).


  👤 coldtea Accepted Answer ✓
Because Ruby was tied to Rails, whereas Python had both a Rails competitor, not as popular but decent enough to be used by several big companies (Instagram, Pinterest, Spotify, Disqus, Bitbucket, and others), plus libraries for science, and later for the rising field of machine learning and even AI.

That said, Python was always more popular than Ruby to begin with (more jobs, more programmers, more college CS classes, more books), even in 2000-2010. Ruby was liked, but was only hot because of the Rails connection.


👤 huevosabio
Python grew out of a myriad of applications that built on hard to replicate components, while Ruby relied only on web development which is remarkably subject to fashion.

Python is very simple making it easy to learn. Thus, it became more and more popular for fields where programming is not the main task, like science. It is also very easy to extend with C. So, these fields could bolt on time-tested scientific code into their Python scripts.

Ruby seemed to be entirely tied to Rails.

When the 00s and 2010s came with needs for web development and scientific computing for big applications (e.g. ads on social media), there were multiple language options for web development but really only one that made it easy to onboard academics into the task of building software systems.

From there, it was just a feedback loop, and when deep learning became a major field, the ML community was already knees deep in Python, so it was hard to justify making tools elsewhere.

Meanwhile, it seems to me, that Rail's appeal (and with it, Ruby) was taken by Node's promise of using the same language on both server and client, and more generally diluted by the fashion waves of web dev.

If you want to swap Python for another language in scientific computing, you will soon find annoyances that certain packages are missing, or don't talk to each other well, or aren't optimized. If you want to swap Ruby for another language, you just use the other language web dev library and that's it.

As an aside, Julia has been the promised replacement for Python for over a decade. It tries and does replicate the package ecosystem, the ease of use, extendibility, etc. It also goes out of its way to be able to use Python packages out of the box. But it just seems to be very hard to convince practitioners to go to Julia for just some small performance changes.


👤 mydriasis
It writes like English and you don't have to think about memory. Those two things are _huge_.

👤 Qem
According to David Beazley, it was lucky to already being around by the time scientific computing folks were in need for dynamic languages as wrappers to help with increasingly complex hardware and projects written in lower level languages, and the only other viable alternatives back then were Perl and tcl. Watch this talk: https://youtu.be/4RSht_aV7AU?si=d3rJvYJPFGcRy6BK

Then it just snowballed since that time.


👤 Ekaros
Because Python is not horrible general purpose language. In the end not everything is web.

👤 beardyw
No language ever won. When I started COBOL had won, not so today. Over the years various languages have won. Python is popular today for many but not all applications. That's about all you can say.

👤 Someone
> My impression is that in the ‘00s, Python and Ruby were both relatively new

They were, but Python is close to 5 years older than Ruby (February 1991 vs December 1995), so in the ‘00s, Python was significantly older than Ruby.

Ruby also was more or less a Japanese-only thing until around 2000. https://en.wikipedia.org/wiki/Ruby_(programming_language)#Ea...:

“In 1999, the first English language mailing list ruby-talk began”

“In September 2000, the first English language book Programming Ruby was printed, which was later freely released to the public“

In contrast, Python was posted on alt.sources from the get-go (https://en.wikipedia.org/wiki/History_of_Python#Early_histor...).

So, effectively, Python had about 9 years head start on Ruby in the English speaking world.

> when, in my opinion, Ruby is the better language

IMO, its flexibility makes it deceptively simple. Certainly, early users used its flexibility a bit too much to implement useful functionality that felt like spooky actions at a distance for newcomers.


👤 znt
I think it just survived naturally, filling in the cracks left by Java / C++.

And now the era of Textual (https://textual.textualize.io/) is here, python may get the spotlight even more.


👤 singhrac
To offer a slightly different perspective than just "ecosystem", I learned Ruby a few years after Python, and found it kind of annoying, in that many Ruby programmers tend to invent their own DSLs and little hacks because the language is so flexible. I know many programmers love Ruby for class_eval, but it really makes codebases hard to read, and code is read more than it is written.

Python has honestly had some opportunities to die out (2->3 transition, type hinting missteps, incredibly slow, etc.) but survived because writing extensions was always easy and it was taught a lot in universities.


👤 philwelch
> Python’s math libraries, numpy and pandas make it appealing to academics; Python is simpler and possibly easier to learn; Rails was so popular that it was synonymous with Ruby

Yeah, that’s basically why.

Back in its heyday, Ruby had two basic niches. The bigger one was Rails. Rails is still alive today, but after the move towards richer frontends a lot of the hype, and consequently the developers, followed that trend into the JS world. It’s obviously possible to have rich React frontends and Rails backends if you want to, but that isn’t quite what you got with “omakase” Rails.

The other niche was in devops tooling, e.g. Chef and Puppet. But that space moved towards containerization and all of that tooling, more or less, got written in Go.


👤 tracker1
I always thought of Ruby as Perl++ more than anything. It's relatively easy to write, not always so easy to look at and refactor later. As to why Python has won, I think you nailed it, the library integrations and academic space has made it popular and useful there.

Ruby's popularity for what it was, was heavily tied to Rails. As that space progressed, a lot of people came to dislike it as much as anything, and maybe more. There are a lot of ways it didn't work so great and those warts made more and more avoid it in future projects.

That's my $.02. I started with JS as well, but in '96 and through classic ASP (JScript and VBScript) through VB6, .Net (and C#) then into/through Node.js etc. I also dabbled in PHP, Ruby and a handful of other tech along the way. Python feels like a massive gap in my knowledge base at times, I have a few books to read, but not much in terms of opportunity/need. And the time I've spent on Python, I feel like I'd rather spend that time leveling up in Rust.


👤 monroewalker
I often hear this kind of praise for Ruby but have never really dug into it myself. Does anyone have any links to pages that do a good job of covering some of the main selling points of Ruby in terms of syntax, features, ecosystem, etc.?

👤 ActorNightly
Languages that won, win, and will win are all of those that are moving towards being smart, in the sense that the compilers/transpilers infer what the programmer is trying to do and generate the appropriate code under the hood.

The future of programming is describing the majority of programs in something thats even closer to English, and then fine tuning it with something like python, all of which will result in natively compiled optimal binary.


👤 bjourne
It has very little to do with Python itself. Python won because GvR ran an extremely tight ship. And there were many extremely talented core developers that helped make Python a polished product. The development team made all the right decisions, except for rejecting PEP 355 which was a big mistake. The batteries included approach helped grow the ecosystem. Developers wrote third party libraries in the hopes of them eventually, someday be incorporated into Python's standard library. Python also came in an msi installer and made the Windows experience pleasant, unlike Ruby and Perl which iirc were painful to get up and running.

👤 ifyoubuildit
My primary exposure to python is when it is failing in some way, often when I wouldn't have even known python would be involved (like trying to install something with npm or apt).

I'm sure this is less of an issue when you work with it every day and are familiar with it, but I always dread seeing python in the requirements for something because it means the odds of it "just working" are probably not great. Anybody else have this experience?


👤 runjake
Coming from Perl, I love Ruby (for non-Rails stuff), but end up using Python because:

- The documentation in the Python ecosystem is generally better.

- There's more Python libraries, and they're generally better maintained and better documented.

- Python has a better interface to C.

- Python is more popular and generally more supported by third parties.

- Django/Flask

- There is comparatively little Ruby activity outside of Rails and a few cybersecurity projects.

I really do not like Python. I think it's really inelegant. But it's a better tool for getting my tasks done, due to the above reasons.


👤 version_five
I'll just add that python provides a pretty good transition for matlab people doing scientific programming, it keeps all the simplicity for scripting, had a good range of packages, etc, another person brought this up too.

For the generation who used matlab in grad school and then abandoned engineering and science to become software engineers, it provided a good soft landing to transfer skills.


👤 james-revisoai
Ruby was more popular, especially when Rails exploded. It was great for scrappy startups, that didn't need Java level quality (and costly time) nor the risks of PHP 4.

The python modules eco-system lead to the stake change. Scikit-learn, Pandas and Numpy made it so useful for visualisation, research, old school modelling ML. Writing and saving files was simple. Making your own module took 2 files with 4 lines of code. How easy.

After establishing use cases in Python 2, which already allowed a lot of C code in practise for speed, Python 3 changed everything with a simpler language that makes it clear what is normal and weird. You might dislike [:-1] at first, but you definitely know it's weird compared to other languages, so you can know what to search for. Not true of abstractions in some other languages like Ruby, for migrating devs.

Then Python caught with Tensorflow/PyTorch a real wave of being the place to go. Kaggle involved 100,000s all coding in Python for data science in the latter half of the 10s. It did this at the same time as the LAMP stack and LAMP pre-installed VPS running cPanel were dying to React/node.js and PaaS approaches on the one hand, and big cloud providers on the other. So suddenly, there was not an easy default 'nix environment with PHP to rely on being available so easily, and adding python to an existing server is super easy (and Flask/Django easy to grep), making adding a backend for ML or whatever, very easy too. Ruby wasn't even on the playing field for many of these use cases.

I think a last small impact was that Ruby was misused where shell scripts could have worked. Many people made Ruby cli tools for their internal team, when shell scripts would have been fine - this frustrated some of their peers away from Ruby. There is no difference from Python here, but I just noticed it more.


👤 Scarblac
Python got Numpy very early on, and other languages never got an equivalent.

And then lots of things were built on top of Numpy - image processing, reading GIS raster data, scipy, pandas, etc etc - and they're all trivial to combine because it's all just Numpy arrays.

Python also had a very friendly and approachable community from the start, and great docs, while Ruby had its documentation in Japanese only for some time.

Django is also top quality, imo. Similar to Rails. But it always seemed Ruby was only good for Rails, whereas Python combines with everything.

So as usual, it's not about the language, it's about the rest.


👤 reducesuffering
Python is the scriptiest lang that is mostly understandable from other popular C-based langs like C++, Java, JavaScript.

Ruby is too different; too many symbols and idiosyncrasies inherited from Perl, Smalltalk, and created by itself.

That is the root reason why they diverged and Python ended up with the scientific ecosystem.

This is further evidenced by Ruby’s popularity only shooting up with Rails, when 2005 web 2.0 attracted lots of non-CS people to come into the field with no prior C-based experience, so they learned Ruby, html, and css fresh.


👤 aidenn0
I first encountered Python around 2000. At the time Perl was more popular in the circles I frequented, and TCL probably about as popular as Python (eggdrop[1] notwitstanding), but Python was growing steadily. I encountered Ruby in the late '00s (as others have noted it made its english-language debut almost a decade after Python started) and Lua was another contender during this time.

My memory is that, at least outside of the web/RoR world, Ruby at no point as popular in the US as Python. Lets take, say 2005 as a point that Ruby was really gaining popularity due to Rails: at this point I was already seeing internal tools that previously would have been written in Perl being written in Python.

Python just seems to have maintained a certain momentum, and I'm not sure why, but if I had to guess:

1. The syntax is almost a dead-ringer for pseudo code. The first time I encountered Python, I fixed a bug in an open-source project having never seen Python before. I recall two different CS programs switched to Python from Scheme for exactly this reason.

2. It was designed to glue C together. Other languages were too (TCL and Lua; Perl primarily interfaced with the outside world in the same way shell does, with pipes).

3. A kitchen-sink approach to the standard library helped it a lot for the first 20 years of its existence. CPAN was sui-generis at the time for installing libraries, so the more you could do without relying on 3rd-party libraries, better off you were.

1: https://en.wikipedia.org/wiki/Eggdrop


👤 stcroixx
Python lets people who would not otherwise program write programs. Back in the day the same people used excel with macros.

👤 aaron695
The other comments answer this well.

But I'll add Ruby on Rails and a lessor extent Ruby was pushed by hipsters hard and people who didn't program but were internet explorers.

Python just was. You'd never have not considered it a language.

I always thought having Python 2 and 3 held it back a decade. The fact it won despite that means to me it was never a contest.


👤 vb-8448
In python you just write your business logic. For any "low level"/non-business aspect, you already have great stdlib and rich ecosystem of third party packages.

People care delivering features rather than design and build the best in class architecture.

I wish javascript adopt the same python philosophy, rather the actual "spaghetti mess".


👤 lacker
Ruby was never that great of a language. Rails was much better than any alternative, though, and it brought Ruby along with it. Basically every company using Ruby chose it because they wanted to use Rails.

The main thing that has led to the decline of Rails is the rise of no-HTML-just-an-API backends. Your web frontend development stack is more likely nowadays to be, first you pick between React or a similar framework, and then the backend just sends API data and doesn't mess with HTML. This makes for better websites, and it makes joint web and mobile development easier too, because you're going to have to build that API anyway for your mobile app.


👤 carapace
[delayed]

👤 mixmastamyk
Weird/ugly syntax always turned me off ruby and perl. Js a mess, now with good parts.

Unfortunately Python has a lot more colons than it used to, and has gotten less readable recently.


👤 dekhn
Because I loved C, liked C++, but hated writing complex programs in either language (circa 1995) and somebody said "try python, it's object oriented and easy to use" and I still use it today as my preferred language for a wide range of tasks. it just feels like a macro language on top of C/C++ in some ways. Numeric Python, then numarray, and numpy transformed my way of working with multidimensional data.

Perl: could not stand the syntax or the language philosophy

C++: too many footguns

TCL: a bit primitive for what I wanted to do

Java: ugh. just ugh.

Go: not targeted at my use cases


👤 gte525u
Python had significant traction back in the late '90s (~1.4/1.5). It was perl vs python vs TCL (possibly vs Guile) back then.

Cross platform and the ease of integrating to other codebases (both extension and embedding) are two parts. Perl's transition to Perl 6 seemed to hurt/fragment that community more so than python 2000 did to python. TCL seemed to slowly die except for a couple niche applications - possibly expedited by Sun's slow demise. Guile never really ran well on non-*nix systems.

Fundamentally python had more C/pascal flavor than Ruby's smalltalk's flavor. That made it easy to teach/adopt. A couple big name universities moving from scheme to python for intro CS helped too.


👤 htrp
In scientific computing, Python also "won" versus R, primarily because of the deep integration with SWE concepts and the ability to wholesale lift concepts from other languages through the ecosystem.

I'd argue numpy/pandas are so fundamentally different from base python that you need experience in those as well.


👤 m0llusk
Readability. The most important thing for code is to be comprehensible by developers. Python has several factors contributing to readability. White space as syntax is the most obvious thing. More than that, unlike Perl which has more than one way to do things Python tends to have one or maybe two canonical ways of accomplishing common tasks. This makes it easier to navigate code without having much experience. Python was also good at interfacing with existing libraries from the start so a lot of work got scripted quickly in Python using high powered C libraries. Arguably being able to work with popular C interfaces was yet another factor contributing to generally high readability of code.

👤 Stranger43
Python kind of had three things that really mattered, an culture of “one correct way”, an invisible but conservative type system, and an style guide build into the language an dictated from the language designers in the form of significant whitespace and PEP-8.

Ruby could have been a contender but still had some of the “there is more than one way to do things” left over from perl(ruby was kind of an pragmatic alternative to the “real soon newer” of perl6) and it’s a bit more dynamic than python in how it handles variable internally.

And the field of academic data crunching was hurting badly from the fact that the two only viable options for most entry level researches was Excel/VisualBasic or PERL so everyone wanted some level of structure which the python community led by Guido provided, once people begun to settle on bumpy and pandas.

And pythons popularity definitely grows from the fact that it’s what non programmers learned as an alternative to Excel/SPSS/SAS/Matlab(all of whom are expensive proprietary tools) in classes focused on analyzing data.


👤 johnea
What exactly did it win?

The prize for greatest number of incompatible versions?


👤 r_thambapillai
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 app. Since people first learning programming to build a web app would usually start with javascript anyway (since a lot of very first projects might not even need a backend), it was a lot easier for the Nodejs/React route to become the default path. Whereas if you were a data scientist, you started on python, and as you got better, you basically just kept using python.


👤 tobinfricke
When I first encountered Python, it was as an alternative to Perl.

Given the choice between Perl and Python, I think it's clear why the latter won out.


👤 jmugan
I moved from Matlab to Python in grad school once my thesis program got too big. It's open, which beats Wolfram. You don't have to manage memory, which beats C/C++. And it has a lot less boilerplate than System.out.println('Java').

👤 latenightcoding
Good marketing: it’s not even a simple language but people marketed it as executable pseudo-code and it worked.

Also Perl dropped the ball with Perl 6.


👤 38
Ruby is really, really slow.

Granted most interpreted languages are, but ruby startup time last I checked was at least 30% more than python.


👤 moonchrome
Ruby was never similar in popularity to Python. It was just a fad in webdev circles. I've rarely seen ruby before RoR and I've seen python all over.

Python was popular as a teaching language, how it gained a foothold in academia.

I remember 20 years ago when I was starting out it was popular for game scripting (Lua was more embeddable but python was also used). plenty of first class interfacing methods to native code (still remember c++ boost shipping python binding generator).

Many tools shipped python as an embedded scripting language.

Python was used for creating build systems.

Not to mention any distro out there ships python, it replaced perl in that regard. Batteries included and being available helped it become the norm for random scripting.


👤 rich_sasha
I think the middle growth was driven by the "second best at everything" meme.

Python is not the best at most things but a close second or third usually (system scripting, data munging, web programming etc), meaning it is easy to get into the language for one use, then continue using it for other things.

Ruby or Go feel like something that ended up specializing in web, so even if they are better suited to it than Python, Python benefits from more cross-pollination.

This will be especially true for small teams, where one language has to cover all bases, and also where "areas" of programming overlap. Need a REST server to serve up MP model results? By virtue of being pretty close to best for both areas, it is actually possibly the top choice overall.


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


👤 dottjt
As a self-taught programmer who started learning around 2015, Python was the least intimidating to learn.

Although I'm a proficient JavaScript programmer now, the idea of curly brackets were genuinely intimidating. Just something about that made the program seem more complex than necessary, and Python seemed really clean.

I also think the book `How to Think Like a Computer Scientist` is a large part of Python's success for beginners. In the early days, it was literally the only programming learning book that clicked for me, and it was in Python. Up until then, programming still felt esoteric.


👤 AdamH12113
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 here:

> 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 was my first clue that, in Python, I was actually dealing with an exceptionally good design. Most languages have so much friction and awkwardness built into their design that you learn most of their feature set long before your misstep rate drops anywhere near zero. Python was the first general-purpose language I'd ever used that reversed this process.

[1] https://www.linuxjournal.com/article/3882


👤 jl6
I’m sure it helps that Python is perceived as one of the easiest languages to learn (and the perceptions are largely correct), and thus found itself as the default language in thousands of Learn How To Program courses around the world. This constantly feeds new users into the ecosystem, which has grown to a critical mass.

👤 throwawa14223
I have never encountered a language as easy to pick up and do cool stuff with as Ruby is. Even after years of working with it I still find Python to be a bit of a mess. I think there was an article years ago about how some people liking a product means it is going to die? I'm pretty sure that is me for technology.

👤 ilikenwf
I really wish schools would teach compiled languages before scripting languages.

👤 avip
python does many things well

ruby does one thing very well

So apparently the "do one thing well" thingy doesn't always hold


👤 jacobgorm
Same reason Pascal lost to C. Life is too short for BEGIN and END.

👤 taylodl
Python was developed in the late 80's and first released in 1991 - it's been around awhile. One of the things that always made it useful before it became so popular is its great interop with C/C++.

Ultimately that interop led to NumPy and SciPy, which allowed you to use a rather simple language and yet get high performance when doing calculations. That, as they say, was that.

It doesn't hurt that Python is a multi paradigm language - unlike many of the other popular languages today demanding a particular mindset for programming. You want to do structural programming? Fine. Object-oriented? That's fine too. A little bit of functional (lite)? There's some limited capabilities for that too.

Add in 30 years of Java JIT compilation optimizations that's been applied to Python interpreted code, C/C++ interop - Python is a simple, yet powerful language. That's why it's become so popular.


👤 p1mrx
Python's old as dirt; it even predates Linux: https://en.wikipedia.org/wiki/History_of_Python

Sometimes the key to success is to just be adequate for a really long time.


👤 mkl95
Python beat Ruby because it's boring technology, whereas Ruby prides itself on being as clever as possible. Take a large application written with Django vs the equivalent Rails app. Even if the Django app was written by mediocre engineers and their Rubyist counterparts were very smart, it's probably much easier to spot the footguns in the Django app. The cognitive load of the average Rails monolith is almost unbearable to non Rails experts.

👤 vmchale
Python manages to have decent performance because NumPy uses an APL-like model and it happens to skirt the design flaws (dynamic typing, interpreted). J for instance has a tree-walking interpreter written in C that performs well!

Ruby's poor performance hobbles it even in places it's supposed to be good (twitter was rewritten to Scala over rails).


👤 umutisik
I don't see this mentioned often: One thing that interpreted languages like Python have over compiled languages is that all libraries have to be open-source by default (unless they are wrappers). It makes it a lot easier to debug and put in minor fixes on the fly.

👤 EamonnMR
Rails was really good at building a very specific type of website and that kept Ruby popular for a while, but SPAs resulted in back end web apps that mostly just shuffled json around, something you don't need Rails for (though rails does a fine job of it) with it's page-oriented world; that responsibility got delegated to React.

Meanwhile, python ended up being the default programming language taught to domain experts in a ton of different domains. Having your engineers write the same programming language as your domain experts turns out to be really useful for business. Using NodeJS as your backend if you consider web your domain is also an excellent choice and also eats into Rails' market share.

I have seen some shops with modern rails deployments do truly awesome stuff, but it's hard to beat being able to take a script an analyst has written, hit it with a linter, and throw it into your production application.

Also, for what it's worth, the python 2/3 debacle was a much bigger deal back in the height of Rails' popularity. I was genuinely worried that the schism would continue to haunt the community; that someone would fork 2.x and we'd have two competing pythons. That didn't happen thankfully.


👤 cutler
Whilst the design of Ruby is far superior, Python has a wider range of data structures which may explain why it managed to gain a foothold in the scientific world. Both are multi-paradigm languages but procedural Python is also a little more idiomatic than its equivalent in Ruby which maybe makes Python easier for scientists who don't want to go all-in learning a more elegant language. Pretty soon in Python's rise it became all about libraries. Ruby never took the scientific world that seriously until it was too late.

👤 daft_pink
My anecdotal experience:

I found it really easy to adopt and use as a non-programmer. I ran out of rows in my excel spreadsheet, and needed something that would ingest my spreadsheet quickly. It took me one line of code to import, and then one line to export.

I was quickly off to the races with deep data analysis and felt it worked so much better than excel as the calculations were more readable and reproducible.

I learned Ruby for Ruby on Rails before this, but it just isn't as quick and easy.


👤 bandrami
The competition in the early oughts was Perl (and PHP, but sticking with general purpose languages). Python was widely seen as "better" in some abstract sense while Perl was what everybody used for their day job.

👤 3np
[delayed]

👤 atoav
[delayed]

👤 amelius
The ecosystem and critical mass.

👤 chombier
I would say Python won because IIRC it was meant to be a glue language between C libraries (something between C and bash) from the beginning.

This made it fairly easy for anyone to provide Python bindings for existing C libraries, so users could enjoy a large number of packages in order to get stuff done quickly.

Then of course, numpy/pandas etc.


👤 svilen_dobrev
long time ago (2007??), GvR asked in the maillist, "what topic to talk about in next coming PyCon"

what i posted/suggested then was something in the lines "how to make Python not to be next Java, i.e. turn into carreer-language". of course nobody noticed.

Well, seems python did become next java. kind-a. i cannot decide is it good or bad.


👤 analog31
I think community played a huge role... the language basically want viral in terms of people sharing code, libraries, tutorials, and commentary.

👤 andrewprock
This has been touched on in other comments, but I think it bears highlighting.

The ability of python to integrate with C/C++ code went a long way to making it a long term viable platform. If you needed scripting you could code in regular python. If you needed advanced control of hardware in your scripts, you could write a python extension in C/C++ to gain access to that hardware. If you needed high performance, or high parallelism, you could likewise create an extension to solve those problems.

In this way Python was the best of both worlds. Elegant scripting which could be combined with blazing performance and low level hardware interfaces. This aspect of the language allowed it to have a wide footprint (as opposed to just the browser) and to leverage legacy libraries effectively - e.g. BLAS.

I personally did crazy stuff like: "embed a python interpreter in a C program, to use python scripting within the program" back in like 1999.


👤 Buttons840
What concepts does a language force a new user to be aware of, and how reliable are user's first intuitions about those concepts?

I would argue that Python dominates Ruby in this metric.

New users wonder how to call functions. They form an intuition ("use parenthesis"), but it's unreliable. "Oh, parenthesis are optional--oh, parenthesis are only optional sometimes".

New users wonder what a function is exactly. They form an intuition, but their initial intuition doesn't encompass all 7 different types of callables in Ruby, so many surprises await.

Python is much more boring in this respect, users are more likely to form accurate intuitions.

This is my opinion as someone who likes Python but hates Ruby. I learned Python in the mid 2000's while trying to script Asterisk. Asterisk had an existing community around PHP and Ruby, so I looked at Python, PHP, and Ruby, Python appealed to me most. I remember being very confused about what Ruby "gems" were, I thought they were something like "JavaEE" that I'd heard about in passing at school, some kind of compiler plugins or something complicated. Python had "libraries" though, I knew what they were. These were my experiences as a new developer giving both languages a fresh look.


👤 natch
[delayed]

👤 drbig
So instead of the original long-winded pour-down: Python is good enough and easy enough. And it made it a thing for people interested in solving stuff with software - as opposed to people making software to do stuff - and that is a crucial if subtle distinction.

I don't like Python but I'm getting paid almost a decade working with it everyday and... it is good enough.


👤 ketralnis
There's pretty much never a "why". Fashion is fashion.

You can look back at some things that occured and say "well it's because it's easy" or whatever, but to be rigourous you'd have to also apply that to the languages that _didn't_ win, and the reasons that they didn't win to Python, and at best there's loose correlation.

This is the same as people that point to "why" billionaires are billionaires. There's a whole lot of luck to it that you can't discount.

Further, I'd question the premise. It's clearly the first thing that people reach for in ML and in the top 3 for web backends. But it hasn't always been that way and it won't always be. Programmers have way too much ADD and contrarianism for any such state of affairs to last for long. And in other spaces and even in other social circles it would be unheard of.


👤 laurencerowe
I think Python's enduring appeal is down to the combination of its very human friendly syntax (which drew on earlier work on the ABC language at CWI) and its practical approach of wrapping existing C libraries so it could be used as glue code for many different domains.

By contrast I feel Ruby was very much a one hit wonder with Ruby on Rails.


👤 dannyobrien
This maybe chicken-and-egg, but Google standardised very early on on Python (along with Java and C++) for their internal work, and sponsored a lot of the open source infrastructure. So even though Ruby attracted a lot of attention for a big chunk of time, there was no diminishing in the baseline popularity and functioning of the Python ecosystem.

👤 Dowwie
Responsive languages with tight feedback loops make great tools involving the analysis of data. Python is very good at this, as is Elixir. Both languages are extensible, featuring foreign function interfaces allowing applications to communicate with faster libraries written in C, C++ or Rust when the need arises.

I don't think we're going to be talking about languages winning any competitions soon, once we're generating programs with natural language. Natural language is going to win the competition in the long run.


👤 soumendra
People seem to be forgetting that in the first few years of Kaggle, R was the language of choice, not Python.

That changed very fast once deep learning arrived on the scene. Plus the Python ecosystem kept getting better. Google/tensorflow/python was the final nail in the coffin, and the ecosystem had irreversibly shifted to Python.


👤 1vuio0pswjnm7
What did Python win. Serious question. Is there a contest between programming languages. If yes, what is the prize for winning.

👤 treprinum
Academics started pushing it and it replaced MatLab for many of their tasks. Then ML started exploding and that was already all in Python.

👤 0x6461188A
There is no win. This is an infinite game.

👤 allanwind
Projects that I haven written in Ruby has bit-rotted faster than anything else (libraries but not Ruby itself). The tiny webapp I wrote to test out Ruby on Rails has broken on every single major upgrade.

👤 at_a_remove
[delayed]

👤 rcarmo
Way before the data science trend, I started using Python 1.2 because I could do quick, reasonably fast, and superbly readable scripting. I stuck around through 2.x because I could interop with C libraries via Cython and write very solid, readable and maintainable web services (I used to contribute to a Python SOAP library), and I once replaced a hideous amalgamation of PHP and Perl with a event-driven Python API service that was superbly efficient by comparison.

But the reason I stuck with it was quick turnaround and solid, maintainable code.

When I was at a local ISP/Yahoo-style portal in the 2010s, it was fashionable to run our own music and storage services. One of our teams implemented a Dropbox clone (called MEO Cloud) that was API-compatible (and had a Python client that I helped test).

At that time, we had a resident music streaming service that had a massive storage array on-premises, and we had a branded music streaming app to go with it. We wanted to implement a Shazam-like functionality, so I borrowed two big multicore Xeons, built an audio fingerprint indexer fot it based on a (now defunct) OSS library, and indexed the entire thing (some hundred million audio files) with Celery. It took me 3 days to write the first version, and two more to tweak things (fingerprinting was done in C++, and the only real constraint was datacenter network).

At that time we had a lousy experience with Rails and Ruby. I was using Basecamp and was interested in it (plus I wrote quite a bit of Ruby for Vagrant and Puppet), but the people we hired to do two or three Rails projects never managed to deliver anything usable or maintainable (since we were mostly a PHP/Java shop when it came to front-ends, reliability and scalability were paramount, and gems were hell to deploy and troubleshoot at the time).

I moved to Python 3 with minimal hassle (perhaps because I took great care in the dependencies I picked), adopted asyncio to great effect (I use my own asyncio code to batch writes to Azure storage these days), and all the while it has remained a very enjoyable, readable language (except when I come across poorly written OOP code that reads like Java fanfic).

My own coding style is closer to LISP/functional programming (I am actually refactoring a piece of code I wrote eight years ago in Hylang, the perennially under construction LISP-equivalent), and I love virtualenvs, the AST, the way I can use decorators to modify code behaviour, and, of course, the fact that today I can run and work in it everywhere (I have multiple interpreters on the iPad, for instance).

I could go on, but I've essentially been using Python as a mix of C/C++ glue, some fairly involved functional programming and a lot of multi-processing and concurrent code (I tend to push the interpreter to the limit when I can't use Cython). And I even wrote my own PasS on 1500 lines of it: https://github.com/piku (which I still use today).

From where I'm sitting, Python won because it is a great, maintainable glue language with some pretty much rock solid libraries (not just the standard library). Bottle and Django come to mind, although these days I'm more into aiohttp.


👤 kazinator
[delayed]

👤 kriro
All imo but in the beginning Python took Perl marketshare for scripting because it was simply less "esoteric". 10 Python programmers wrote similar programs to solve the same task whereas 10xPerl programmers would be more creative. All while coming with "batteries included" which helped to get stuff done quickly. And Python has always played well with C so you could optimize if need be.

At the same time, Python was a pretty early adopter for the server backend (and stuff like Zope existed) and also had great interopt with databases but PHP was a stong contender/#1. I'd say Rails timing was off by a bit or Ruby would have gotten more momentum (at that time there were already many things in Python land to compete like Django etc.). Meanwhile JS was still pretty cludgy to use and required a lot of hoops just to set up an environemnt and things like node came a bit late as well or JS would have taken more "web backend marketshare" from Python immediately. There was a window when the Python 2->3 transition slowed things down (imo) but overall it went slow but smooth for such a big transition.

Python was also an early player in other niches like security (both scripting and tooling).

And when ML happened to take off (grossly simplified) once again Python was there as an early player with good tooling and support for most things and with excellent ties to scientific computing.

It also got good support early from some key players, most noteably Google.

So basically, Python was always there when it mattered and "good enough", came with "batteries included" and the Python community has always been great + willing to quickly get working tooling and libraries in all relevant areas. Importantly Python has always been beginner friendly enough to attract a decent chunk of non programmer specialists from other fields that used it to dive into programming (scientific computing in general but biology comes to mind as a typical use case).


👤 mcemilg
I think it's just by a chance, Ruby could win too if the data people first gather around it.

👤 tamimio
I remember when python started, perl was there, and when I wanted to write scripts for some pentesting, perl was the choice over python. But I think the whole “data scientists” crowd is what made it popular and mainstream, they are usually non-programmers, and looking for an easy way to manipulate the numbers, speed or performance isn’t really the priority, that use case is fair, what is not good is the other crowd, people who want to use python for everything and shove it everywhere, backend!? Sure, embedded?! Absolutely, heck even frontend I saw some are trying to use it and marketing it “pure python”.. even ML I believe we would be at a better stage of Python wasn’t the main tool used in that domain.

I can’t say much about ruby, barely used it, but if I were you I will look at Go, it’s definitely better than Ruby and still ahead in terms of performance, not the top one but for its easy of use, it is probably the best choice.


👤 seydor
I m still not convinced it won. If google dies tomorrow, how long would it survive

👤 fwungy
The much reviled Global Interpreter Lock(GIL) slowed python down, but also made it really easy to write libraries for.

If you wanted to do something there was probably already a Python lib for it. Nothing else had such a rich library ecosystem. If you really need python to perform it is usually easy enough to write the needed routines in a lower level language link it in.

Python grew because it was so easy and powerful enough. Now that python loads are getting into substantial computing the efficiency is becoming an issue.


👤 xer0x
Good timing, our company is in the midst of migrating from Go and JS over to Python. I'm struggling with this. Yet, most developers feel they will be happier writing Python for our web application.

I don't know why Python has outshined its contemporaries like Perl, PHP, Java and Ruby. It has done a great job, and there is probably much to be admired.


👤 __mharrison__
In a word... numpy.

👤 Koshkin
Jupyter (Lab) is the best thing since sliced bread. (I don't know if similar environments exist for JS or Ruby.)

👤 Waterluvian
I’ll take a stab at it:

Python is good enough at everything.


👤 simlan
I am one of the likely millions of people that got sucked into python for its accessibility and powerful data manipulation libraries. Granted I started in the mid aughts with web scraping and other stupid endeavours. That user base growing out of matplotlib/numpy later pandas at a time when data literacy got more important is I think the major driver of its success now.

Also does not hurt that it was designed as a teaching language at first. Nowadays reading some of the code that is out there I feel like I have no idea what is going on. Type hints and that way some libraries use it makes my head spin sometimes...


👤 JAlexoid
Reason is simple - Ruby is not good enough and lags in many, many, areas.

Ruby was an unknown till the RoR was introduced. And the reason why RoR was so easy and popular, was Ruby's biggest shortfall - excessive metaprogramming. The automated creation of all of the CRUD operations was definitely a kick in the... of Java and many other languages that lacked such ability. But that comes with all of the readability downsides, when "programming by convention" lacks a commonly understood convention. (Scala also suffers from it, just that Spark works so well for majority of it's use cases)

The worst part for Ruby, was that none of the features that RoR brought were hard to implement in other languages. Others caught up and Ruby didn't get enough windfall to keep sailing.

Then there was the community, that RoR attracted in the early days... the best way to describe it was - toxic.

> how fun and easy to use it is

First impressions are deceptive. When RoR was getting popular, many people who said the same typically showed me an example of some functionality implemented in just one line. Which is not exactly a great case for a programming language.

As for Python - it just grew steadily. Building the fundamentals and spreading. Having strong opinions from a single person made Python very easy to read and understand. It's by far the easiest popular language to use to demonstrate concepts to anyone - there's a very gentle learning curve. The community, tooling and documentation - are considerably better than Ruby's.

Remember that there are really beautiful expressive languages that make people fall in love with... but syntax is just one small part of it.


👤 madmountaingoat
Contrary to what many have said I think Ruby's popularity started to rise a bit before Rails. It got an earlier bump from being talked about in the 1999 Andrew Hunt and David Thomas book The Pragmatic Programmer.

As for why it beat our Ruby; in those early days Python tended to win the performance comparisons. That led to people using it for more demanding data tasks, which in turn led to more libraries for those sorts of domains. The parallel growth of jobs demanding those capabilities (data analytic and AI), cemented its supremacy.

That all said, if I need to hack a script together to automate some development task - in the vein of what Hunt and Thomas described back in 1999, I still reach for Ruby.


👤 BeetleB
Adding my 2 cents:

Python was not relatively new in the early 00's, but its popularity really started taking off around that time. It is older than Java and Javascript.

Ruby became big primarily because of Ruby on Rails. Python was already big before Django came around. In fact, one of the reasons Django exists is "Python is cool, and we need a good web framework for it".

Why was it already popular? My guesses:

Very easy for new programmers, but enabled you to build fairly powerful stuff with it (unlike, say, BASIC). Eric Raymond, around 2000, wrote an article on why he loved Python, and the main takeaway was that within a day or two of encountering it, he was already building useful scripts with it.

Has some functional programming aspects that appealed to people (e.g. lambdas, map, reduce, filter, etc). Has laziness if needed.

But the real reason: It was not Perl, and was a viable alternative to it. It explicitly was against Perl's philosophy of "There's more than one way to do it."

Batteries included: Every standard Python distribution came with what was then a really good set of libraries. Sure, Perl had CPAN which was more extensive, but consider that not everyone had high speed Internet, and you still have to do the labor of identifying which CPAN package you wanted. For many Python developers, the standard library was all they needed.

Then with NumPy, it became a good alternative to MATLAB. Although started to be heavily used in scientific computation 2006 onwards. With pandas people started abandoning R for it, even though R is, and continues to be, a better statistics language. With Numpy and Pandas available, machine learning easily followed in the early 2010s.

The benefit of Python over stuff like R and MATLAB (and possibly JS) is that you have access to all the other libraries. In those days, if I wanted to write some code in MATLAB, but have it also crawl some web pages, and do some scripting, it was a pain. You'd write the MATLAB code to deal with the computation, and separate scripts for the rest. Now I can do it all in one language/program.


👤 jamesgill
Data science/analysis.

👤 stillsut
Going meta: I haven't read a HN thread in years that I agreed more with for almost every single comment. Incredible niche breakdown of the mess of factors that drove happenstance to circumstance. No ideology, just learned on the ground experience. More of this?

👤 dkarl
A lot of people who picked up Python, especially in the 1990s, picked it up as a side language. They were doing "serious" programming in C or C++, and they needed another powerful, potentially cryptic language like they needed a hole in the head.

I believe that Python gained popularity among scientists for the same reason. They needed a simple programming language, not because they lacked brainpower, but because their job was to focus their intelligence on the scientific problems they were solving, not on programming. Writing code was necessary but not meaningful in itself, like washing beakers or feeding lab rats. The less effort it took, the better.

For people like that, Python won because they were able to become productive with it while learning very little about it. Also, it was rare to accidentally write Python code that was hard to read. This was especially important for scientists, who didn't have a software engineer's appreciation of the difficulty of reading code and the need to practice restraint when writing it.


👤 airstrike
Serious answer: the Zen of Python. It makes for a far better version of Ruby

👤 TylerE
Well, for one thing, the versions of ruby were sloow, like an order of magnitude slower than python at the time. It didn’t even have a JIT - it was pure interpretation - if you went through a loop 10 times, the code inside got parsed 10 times.

Also, python predated ruby by several years. Python 1.5.2, which is about the earliest version that resembles modern Python, was release in early 1998. The first Dnglish language book on Ruby didn’t come out until late 2000.


👤 moandcompany
Like SQL, it's terrible in many ways, but in many more ways it's good-enough, commonly known enough, and/or accessible to others.

👤 badrabbit
The ecosystem created an echo-system.

Being default on linux helped python succeed, not anything specific about the language. It became default on Linux because it was better than perl or bash (easier to use and manage deps) and had decent upstream support and an ecosystem around since the 90s.

On windows powershell is still king, python shares the throne as a close second though. Compare all that import-module, nuget, winget, chocolatey,etc... mess with pip! And version nightmares are more manageable thanks to pyenv. Python ecosystem is good at making a mess work well (except when it doesn't).


👤 edanm
What many others here are saying is correct. Python was fairly popular, and considered a great language that good developers wanted to develop in, way before Ruby became popular.

Just look at this article by Paul Graham, written in 2004, called "The Python Paradox" http://www.paulgraham.com/pypar.html:

> I didn't mean by this that Java programmers are dumb. I meant that Python programmers are smart. It's a lot of work to learn a new programming language. And people don't learn Python because it will get them a job; they learn it because they genuinely like to program and aren't satisfied with the languages they already know.

> Which makes them exactly the kind of programmers companies should want to hire.

This was written more or less at the same time that Ruby on Rails was first released. Clearly by then, people had known about Python for a while.

That head-start led it to be more popular early on, except in webdev circles specifically. But in the other circles, and especially in Academia, Python was gaining popularity, which helped it both get lots of great scientific libraries (making it today's default "data" language), and also made it eventually become a language taught in Universities.


👤 DrBazza
In the early 00's in the banks (and other places): Perl was everywhere on the server side, and generally horribly unmaintainable because of TIMTOWDI. On the client side Visual Basic was everywhere. The stars aligned: on the server Python was easier to write, only one way to do it (sort of), and on the client, Python was in some ways similar to Visual Basic (not character soup), and was adopted there as well. And to a lesser extent, Python was also more 'write once run everywhere' than Java.

To quote someone else here, it wasn't the best language, but it was the second best language, and hit the sweet spot for so many domains.


👤 alerighi
To me Ruby syntax looks too magic. Python is much more simple to understand, a person that doens't know python but another language such as C or Java can write programs in like 10 minutes. The only "strange" thing is the use of indentation for dividing blocks, but it's something you easily learn in 2 minutes.

Another thing that helped python is the fact that you can do fairly low-level operations in a very high level language. Python gives you os-level API/system calls that otherwise you would need to use a language like C to have access to. This makes python great to do system programming: indeed a lot of system tools in Linux where performance is not critical are written in python. For this reason you can assume any Linux/UNIX system has a python interpreter, and thus a lot of scripts and tools started to be written in python.

It's also quite easy to call C code from python code, and vice versa (for this reason python is used as a scripts/plugin engine in programs written in other languages). This is the reason a lot of scientific calculation tools are written in python, since they have the algorithms implemented in C for maximum performance with a python API to be able to be used easily.


👤 sebastianconcpt
Because it managed to produce frictionless adoption in academia. All the rest is downstream of that. MVPs in entrepreneurial initiatives are done with that. RESTful APIs are based on the prototypes that come from academia. Good libraries for data processing of lots of data required by academic studies became easily adopted there. So a less-effort/easiest-convenience law inside academia made it win.

BTW, if you enjoy Ruby, watch this: https://www.youtube.com/watch?v=eGaKZBr0ga4&t=705s


👤 zem
having used both ruby and python extensively, my guess is that what gave python an edge is better support for namespacing and stricter adherence to local scoping. it is far easier to read a largish python project and easily see where every symbol the code uses is defined; ruby makes it a lot harder because by default everything is tossed into one big top-level namespace and imported implicitly.

concrete example:

python:

    foo.py:
      def f():
        ...

    bar.py:
      import foo
      x = foo.f()  # very clear where f comes from, just look up foo.py
ruby:

    foo.rb
      def f
        ...

    bar.rb
      require 'foo'
      x = f  # grep through the code if you want to know what f is

👤 orasis
No curly braces. I’m serious.

👤 btbuildem
I've been writing code since the mid-90's, probably in a dozen languages or so over that timespan.

In my experience, Python is "easy" -- as in, you can quickly achieve what you want. It doesn't get in your way with opinions about types or data structures. You can rapidly create horrific kludges that produce the results you want.

Not sure I'd say it's a programmer's language. It's like javascript that way, but without the absurdity and the footguns. It's overall intuitive, and has all kinds of handy shortcuts.

That's the language itself - but it's embedded in an ecosystem of libraries and tools favoured by the data processing / data science community. Given the mad gold rush in the recent years in these domains, it's no puzzle why python is one of the top choices these days.


👤 shrimpx
Perl5 was king in the 90s and early 2000s for building web apps, and as Perl5 faded, Python was the obvious contender and it took over.

Perl5 was built more for CLI programs and text processing tasks, like Awk. As the internet got bigger, Perl5's idiosyncrasies became more evident. People wanted a cleaner and more structured language that could remain readable in large code bases.

I remember building backends in the late 90s in Perl and yearning for something more structured. Perl5 often just felt so hacky and full of magic, often resulting in unreadable code. When I first saw Python I was struck by how clean and uniform it was compared to Perl5.


👤 v64
Many comments have commented on the ecosystem, but I've thought a big reason behind python's success is that it's also a well designed language in terms of readability and lack of surprise. My background was in perl and shell scripting before finding python and the absolute beautiful form of the language (that whitespace is significant in more ways than one!) and its utter insistence that There's One And Only One Obvious Way To Do It (more or less) made programming much more ergonomic compared to the other similar scripting languages at the time.

👤 john-tells-all
I was there.

I learned Python first. I saw Ruby as a "similar language, faster, more syntax-heavy, popular in Japan".

Python "won" because of Guido's focus on ease of use by non-programmers. A bunch of scientists used it to steer long-running computations in C, by binding the fast C math libraries with a Python frontend. Python was so easy to use that new scientists and interns could get started easily.

I don't know why Ruby has stalled out. Its "test first" culture and of course Ruby on Rails, and Chef, are all excellent.


👤 scoofy
I come from an analytic philosophy background. I studied mathematical logic and set theory in grad school as part of my logic requirements. I never learned to program for a long time, and it was always a source of embarrassment. A friend finally suggested that I learn Python because it was "English-like" as you say, so I bought Learn Python the Hard Way.

When I opened the book, unlike java or js, I could just read the code. Like... I could just read it and already understood what was happening. I already knew way, way more logic than would ever need. I think it took me about a day to figure out object-orientation, but it was trivial. I went from not knowing how to program, to being able to run fizz buzz in like a day, and do it with objects in like three. Other languages are so caught up in so much bullshit technical stuff I still can't stand them.

Python is intuitive. It's approachable. I focuses on getting you from zero-to-code over a bunch of much more technical applications. Python is the party that welcomes you in, instead of checking your ticket at the door.

As a non-CS person who has fallen in love with programming, I honestly never want to learn another language if I don't have to.


👤 dyeje
You’re comparing apples and oranges here. My sense of the market is there are a roughly similar amount of companies using Django and Rails to create web applications (maybe actually a slight edge to Rails).

The majority of Python usage is in data, ML, etc which is really an entirely different use case and discipline.


👤 karmasimida
It wins because it focuses on what people can do with it, not indulging itself with some cosmetics level syntax feature.

👤 jokoon
Python borrows a lot from C for its syntax and flavor and imperative style, it's not exactly like C, but it "feels" a bit like C (it's hard to explain why).

Python has a lot of native things like list dict sort join etc, you need library much less often your code gets very very short.

Python has some functional programming in it, which makes it even more flexible than C++ in my view.

Python is just so readable with its indentation style, very few language do it like this. I even started to make a C-ish language with indent-style scoping, it's a bit difficult but I did it.

Even if it's one of the slowest language out there, it's so good and simple that you realize that what matters is not the language speed, but what matters is what you write. A good and fast software must be well designed first, the language choice comes second.

Python is VERY OFTEN the best choice because its simplicity lets you write better software more easily, so in my view, a language like python allows programmers to write better software.

Programming language philosophy matters.


👤 rdtsc
1) Because it was a better Perl.

2) The single CPU speed was doubling every 18 months almost. Wait a few years, stick the program a new Pentium III or whatever and you got a nice speed boost.

3) Batteries included. It was huge quality of life improvement. Want to traverse directories, parse ini files, send emails, socket programming, even edit audio files —- it was all there.

4) Repl. Huge improvement over other existing popular languages at the time. Especially when ipython came about.

5) No curly braces. People were sick of Java and C++ verbose syntax. They were seen as old and crusty by that time so they wanted something new. “Why do I need 30 lines of code to open and read a file?”.


👤 reddit_clone
One reason:

Perl community spent most/all of its capital on the Perl6 debacle.

People waited for years (decades?) for Perl6 to come out. Most moved on (to Python). Perl6 turned out to be a totally different language when it did come out.

Mind you, I love Raku and use it daily but its development did cost Perl mindshare and marketshare.


👤 jacobsenscott
You had to choose between python and perl for scripting, so the choice was obvious. However it wasn't considered suitable for any type of complex application at the time (no scripting language was). Ruby wan't really on the radar when python was becoming popular. Also python billed itself as a simple teaching language which attracted a lot of non-programmers who were intimidated by C and Java. It just kind of snowballed from there.

👤 sesuximo
Python was released first

👤 oraphalous

👤 rubyn00bie
Google used Python; so, a LOT of folks figured that decision was the best one because "Google used it." Google also chose to employ Python's BDFL Guido van Rossum at a key time (2005); which, pushed at least perception of the language forward. Google's support is likely a key factor in the use in data-science, but I don't know the dates/timeline for that as well.

Additionally, during that time the Ruby-core team seemed less focused on performance and more focused on ergonomics. I think the height of this was refinements; which, to my naive understanding were (are?) a real PITA to support/implement for the non-MRI implementations of Ruby. The complexity of the language probably turned off folks who wanted a dynamic language but wanted it to be fast (which is I imagine how all the different implementations of python came about).


👤 acjohnson55
Here's my take.

Ruby essentially stole the thunder from Perl and PHP as the language for back-end development with Rails. But with Django, Python pretty quickly had a more or less equivalent web framework.

Here's my recounting of history:

- For about a decade, Rails remained one step ahead on the cutting edge of web development. Thought leaders like 37 Signals / Basecamp constantly rolled out innovations through Rails, appealing to the most forward-thinking web devs. But Python was never far behind.

- I would also argue that Python is an easier to understand language. Ruby encouraged the development of DSLs with its second-class functions / block syntax, but Python tried hard to keep its core language simple and emphasized explicitness.

- Meanwhile, the simplicity of Python's syntax made it very appealing for developing data tooling, competing with a bunch of expensive proprietary tools, like MATLAB. This exploded Python's userbase.

During this period, I would say Ruby was the hotter language for startups, but Python had a bigger userbase, as the more middle-brow option.

Starting around 2015, both languages started to see other languages encroach on their web dev moat. Node was better suited for simple microservice APIs. People got into typed programming for its perceived advantages. Compiled languages took on a lot of the high-performance systems.


👤 graypegg
We are in a verrrry similar boat! Always been into fiddling with computers but got my first job in tech around 2013. JavaScript and PHP. Only the past couple years have I messed around with Ruby + RoR and I love it.

Every time I have to touch Python to mess around with anything going on in the ML space, it just feels so clunky, in ways that Ruby feels like it wouldn’t have trouble with.

I think r_thanbapillai’s top level comment is spot on. Ruby became a “web” language because of the singular focus on Rails (at least in the west) which hampered its growth in other areas. It’s not so much the language that makes a community but the libraries people are inspired to build with it. Python specialized in the “right” thing for its moment in the sun.

I do think we're slowly seeing Julia or other more purpose built tools slowly eating python’s numpy lunch.


👤 Buttons840
Can I quote zach's 15 year old comment on Python vs Ruby? Maybe it will have some relevant insights:

> Ruby has clever syntax. Python has pure syntax.

> Ruby has method aliases. Python does not allow a string to capitalize itself.

> Ruby uses Ruby methods within Ruby classes to extend Ruby. Python has decorators so you can write functions that return functions that return functions to create a new function.

> Ruby has strict object-oriented encapsulation. Python is laid-back about objects, because you probably know what's going on inside them anyway.

> Ruby lets you leave off parentheses so you don't miss objects having attributes too much. Python will let you mix tabs and spaces for indentation, but passive-aggressively mess up your scoping as punishment.

> Ruby has seven kinds of closures. Python has one, in the unlikely case a list comprehension won't do.

> Ruby's C implementation is a mess of support for language-level flexibility. Python's C implementation is so clean you get the unsettling thought that you could probably write Python using C macros.

> Ruby supports metaprogramming for cases when programmers find it more descriptive. Python supports metaprogramming for cases when programmers find it necessary.

> Ruby is expressive. Python is direct.

> Ruby is English. Python is Esperanto.

> Ruby is verse. Python is prose.

> Ruby is beautiful. Python is useful.

> I like Python, but coming to it after using Ruby for seven years, well, I think it's like dog people and cat people. You can like having one species around, but you're always thinking -- why they can't be more like the other?

-- This is one of my favorite HN comments of all time: https://news.ycombinator.com/item?id=682364


👤 dbtc
Ruby is fun, which is a priority for some

Like you, but you're in not the majority.


👤 pookha
I've always just thought it was just the universities. They train people in Python, which meant that people who had low level libraries written in C\C++ could wrap their utilities in Python so as to capture a larger audience...But I also know that DHH went after a lot of these enterprise software self-promoters shilling "clean code" and they then turned around and bad mouthed him and the Ruby programming language at conferences and podcasts (for years). I can remember hearing from a few different shysters that "ruby is a redundant language when you have python". That sort of negative publicity can have a bad effect on an ecosystem. My two cents.

👤 jdlyga
Back in 2010, most devs were using Java or C++. As any C++ dev will tell you, setting up 3rd party dependencies takes forever especially on Windows. In comes Python with its simple yet powerful core language features, batteries included philosophy, and tons of easy to install packages. That attracted a lot of attention from C++ and Java devs looking to get things done easier. It also attracted attention from systems developers looking for a saner alternative to writing Bash scripts. Not only that, but because of the simplicity of development, it became a core teaching language for learning programming. And because of all of that, it became even more popular when more math-oriented people needed a language to use for AI/ML.

Ruby fits a lot of the same niches. I also remember experimenting with Ruby at the same time I was experimenting with Python. But it's an either/or situation, like HD-DVD and Blu-Ray. Ruby fell into obscurity almost because of the rise of Python. Because we now have a solid ultra-high level language with batteries included, there's less of a need to also focus on Ruby.


👤 ravenstine
- Python was around long before JavaScript became a thing outside the browser (and yeah, I know it was possible for a while, but let's face it, we needed Node.js and NPM)

- A lack of needing "end" syntax is appealing to many new programmers

- Perl is... yeah.

- Ruby, as beautiful a language as it is, but represents everything wrong with OOP and metaprogramming. Lots of footguns, especially when veering away from basic CRUD with Ruby On Rails.

- Numpy, Scipy, Pandas

- The name "Python" sounds cool. JavaScript sounds like Java, but it has the word "script" in it, implying that it's inferior. Ruby sounds like that girl you had unrequited love for.

- The head start Python had meant that many software packages included a Python runtime for plugins, and there's no reason to change this.


👤 imgabe
I started programming around 2007. I actually wanted to get into Common Lisp, because I was heavily influenced by Paul Graham, HN and early Reddit. I did try a couple of web frameworks with Common Lisp, but didn't get very far.

Ruby on Rails was very big at the time, but I ended up choosing Python for a couple reasons. Python was a bit older, it already had a reputation as a scripting language for system administration. It had more libraries like Numpy and seemed like you could do more things with Python. You could script, write desktop apps, use it for data science, while Ruby was pretty much just for web dev.

Even back then there was a huge ecosystem of Python package and it seemed like anything you wanted to do with Python, there was already a decent library available for it. So it seemed like you had more options learning Python. Django was also just coming out at the time, so you could do web dev with Python too. Then Reddit rewrote their site and switched from Common Lisp to Python, so that seemed like a good endorsement too.

Python became as big as it has because Machine Learning / AI exploded and Python was there to benefit from that. Numpy / Pandas / Jupyter Notebooks etc. gave everyone who wanted to learn ML/AI FREE tools that were as good or better than Matlab / Mathematica / SPSS or other software that cost thousands of dollars. Grad students are poor. Maybe their school has a Matlab license they can use, but they probably can't install it on their personal laptop, so they used Python instead, wrote all of the influential papers about ML using Python, then anyone else who wanted to learn from that installed Python and so it goes.


👤 Buttons840
Python and Ruby both have an optparse library in their standard library. Compare the documentation for yourself:

https://docs.python.org/3/library/optparse.html

https://ruby-doc.org/stdlib-2.7.1/libdoc/optparse/rdoc/index...

I learned Python 2.3 almost 20 year ago, and the standard library documentation in Python has always been just as good. As a beginner I found Python's documentation very helpful, I could read the documentation like a tutorial, like a book, a good teacher. To this day I still look at the Python regular expression documentation whenever I'm using a regular expression in any language. I learned regular expressions from the Python documentation, there was literally no blog or tutorial I found more approachable than the Python documentation when I was very first learning regular expressions.

Ruby had, and still has, a list of methods for documentation.


👤 dragonwriter
> Now Ruby is still very much alive; there are plenty of Rails jobs available and exciting things happening with Ruby itself. But Python has become a titan in the last ten years. It has continued to grow exponentially and Ruby has not.

Ruby (outside of Japan, where I understand this has not always been the case) has its popularity almost entirely tied to Rails, Python was much broader, and its resurgence with AI/ML is largely because of its excellent scientific stack which has been around for a long time but people outside of that space often ignored, but which makes it an unequaled high-level glue language in that space.


👤 ah27182
I felt that some of your questions, as well as the general history of popular programming languages, were well laid out in this talk: https://youtu.be/QyJZzq0v7Z4?si=hcPgL_LhWVTtjBdt

TL;DW: The presenter mentions that Python experienced a slow but consistent growth trend, leading to its current prominence. Other points he highlighted about its success align with much of the sentiment expressed here.


👤 pirate787
Python didn't win. PHP adapted and remains the language that powers the Internet.

👤 felipetrz
You started using Javascript after they fixed it with ES6. When I started working with Python, I had just left a NodeJS project in ES5 callback + prototype hell and didn't want to get anywhere near Javascript until they added proper scoping rules and classes.

👤 asciimov
One issue that sticks out to me is that 20 years ago it was hard to get Ruby and Rails installed on a Windows XP System.

While the friction of installation isn't the sole reason why Ruby isn't as popular as Python, it did leave a bad impression on many devs as they shifted their projects to PHP.


👤 nurettin
Python bundled Tk. Academia loved it. Imagine being able to script knobs and dials into your doctorate thesis in a few lines 20 years ago without knowing Delphi.

They loved it so much that they made homework-solving numerical libraries. They turned into numpy.

At some point, almost every undergraduate and most of finance industry was churning python. Python 3 was released. People hated that. Microsoft was interested. Guido started following modern languages. Asyncio was buggy. Pandas was built. Django was jealous of Rails. Not much happened for a while. AI! CNNs! Deep neural networks! Alpha go beat everyone. Tensorflow! Suddenly everyone did pip install. Cuda, pytorch. Ruby got left behind. Asyncio got fixed.


👤 michael_j_x
For ML stuff, it was a poor mans Matlab with great C and C++ bindings

👤 Saphyel
Ruby became popular in the web dev space only, because of the frontend stuff and RoR. When node appeared Ruby became almost deprecated.

Python is not great at anything really, Numpy is good because uses C code, PIP is crap, the stdlib has 0 consistancy, types are comments, you have to learn venv, etc... But Python is everywhere, it is in the web dev, devops, data. And now is even in the browser, Excel, rpi, etc... so learning python means you can do anything anywhere.


👤 harel
Some notable reasons:

  - Ruby was 4 years younger than Python on the day it was introduced and cites Python as one of it's influences.  
  - It's a fine language but besides rails it wasn't adopted for other uses like Python was.   
  - In the UK at least Django is way more prevalent than rails for web-dev. And if Django doesn't float your boat, there is Flask, FastAPI and others.  
  - Python's 3rd party libs are incredibly wide and many.  
  - It was boosted by Google early on which gave it a stamp of authority.  
  - Schools in the UK teach it to secondary students (high school).  
  - Devices like Raspberry Pi came out with full micro Python support.  
  - There is micro Python.   
  - There is Python in Python (pypy).  
  - There is full windows support  
  - The AI/ML/Data Crowd's darling  
  - It's fast enough for most things and getting faster still.
As someone else mentioned - "win" is not the right term here. Win what? A TShirt? a toaster oven? It's just a matter of adoption in specific geographical areas

(Edited formatting)


👤 xupybd
The best language seldom wins. External factors have a greater influence. Such as JavaScript being the only language available in the browser during the explosion of the web. It was not the best language but in ran in the best place.

👤 contingencies
rails was popular but a very high tower of nominally unique abstractions; coming from perl or PHP and jumping on rails it felt as if rails essentially popularised the generative approach to web infrastructure that is now considered standard (though it existed elsewhere previous and since). For that reason many took it up, but were locked in to its way of doing things, and its problem domain. That is to say, rails programmers were often more interested in CSS and matters of web frontend than backend programming, and thus the surge of programmers it attracted probably did less to bolster the language than they could have. Other groups of programmers who also lept on ruby, such as security enthusiasts, also tended to stick to their corner. In many cases, they were later in the piece - early ruby had many problems with unicode long since solved in PHP, for instance. Ruby felt to me as if it simply never became a cross-pollinating community in the same way other language communities did.

Ruby absolutely has awesome features: lovely syntax, introspection, etc. however people do not use programming languages because of the features but more so the inertia (see: C, FORTRAN, Java...)

Meanwhile, python became popular in universities and the bog standard mechanism by which the publication of a library could be ensured with forward compatibility on many platforms. It was boring, and perfect for boring uses. Most software is boring. To my mind it's really a Java replacement, more so than a ruby/php/perl replacement, or at least spans with confidence enough of Java's traditional market to have a foot in the door for general business deployment of arbitrary projects.

Very much like @NeckbeardHacker's quotable "CentOS in the streets, Gentoo in the sheets." I think python is a business language but few multilingual programmers would really write it just for fun. Experienced programmers seem to get their fun from things like lua, ruby, and whatnot. I don't know why, but syntax is part of it.


👤 tanbog5
Some times there's a reason, some times it's just luck.

While I appreciate we love to try and explain the present as an inevitable destination, some times it's just the way the dice rolled on this iteration of the simulation.


👤 webnrrd2k
Lots of other people have commented on why Python won in general. I can say why Python was a better choice for me personally, in 1997 or so...

I was using Perl a lot to manage an multi-thousand page external site, and a much larger internal site for a major division of a large aerospace/engineering company. These ware all scripts to run on the filesystem to do things like change the company name across thousands of pages, where the historical would be kept for past events, but the new company name would be used for current projects.

I sort of semi-nepotisticaly lucked into the job-- I was doing desktop publishing previously, and one of the managers at the division was a relative of my girlfriend. There also were very few webmasters around, and I had a lot of experience with graphics and the software around it.So I taught myself HTML, some basic programming, and was off to the races. But I was basically a just "computer person", but not much of a programmer.

Doing anything by hand on a site that big was just not going to happen, and Perl had a bunch of great pre-made scripts available for doing lots of stuff, but it was murder trying to modify any of them. It was clear that Perl just was too much work to learn, and the "one way" philosophy of early Python made the documentation easier, examples more consistent, etc...

But Python was much more approachable. It was also pretty clear that it had a better future, and had a pretty good (not great) set of libraries available, pretty good regular expressions, and really good integration with just about anything on Windows 95 (via an external COM library). When I started I didn't realize how the ability to script I.E., or Excel, or whatever was a really powerful tool that saved me countless hours. For example, of of the Marketing execs wanted to review every web page, but didn't want to use a browser, so via Python's COM tools, I could script IE to open, log, and print every page. When something failed (e.g. printer ran out of paper) I could use the log to restart wherever I needed. I could also grab a bunch of data from an Excel workflow some engineer had cooked up and dump all the data into a database, so they could use the tools that were comfortable for them, and still centralize it enough to generate dashboards or reports or whatever for management.

The performance wasn't that great, but computers were getting better, faster, all the time, and programmer productivity was starting to become much more of a concern.


👤 habibur
I see the flip happening when MIT switched from Lisp to Python for its introductory courses. That happened in the 00s. They had to choose between Java and some other langues and then choose Python. Gradually everyone else followed. New grads came out learning Python. They started developing with it and took over other langues.

👤 _fdsfs12123
Funny story:

When I took an "intro to programming for scientists" type course in early 2010s, it was taught in Ruby. This was at the height of ROR's popularity, and the instructor must have been curious about Ruby.

So Ruby became my first language, and for a year after taking the course I did all my scripting in Ruby. There was nobody around me (a lab full of C and Fortran coders) to tell me otherwise. Eventually, I switched to... MATLAB, and a couple years later to Python.

And in 2023, I don't remember a lick of Ruby. But I remember it was fun to code in it.


👤 rc_mob
poor php is still ruling the web and still gets left out the convo

👤 mgl
Mojo could be for Python the same breath of a fresh air as Kotlin is for Java:

https://stratoflow.com/introduction-to-mojo-programming-lang...


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


👤 kiitos
Python didn't win, really, in any meaningful sense. It's probably the most ubiquitous language, because it's a great teaching language, and works reasonably well for a bunch of different kinds of users -- but only to a point. A jack-of-all-trades is a master of none. It's extraordinarily difficult to use Python in large, high-scale, or otherwise non-trivial systems. (Same is true for Ruby, for the record.)

👤 Humphrey
Another reason is how much the standard library provided (csv, zip, so much). The XKCD comic says it all

https://xkcd.com/353/

In a world before good dependency and package management, being able to do most things using the standard library made things much easier!


👤 tetsuhamu
Ruby lends itself to a certain kind of "decomposition" or "factoring".

In a functional programming language, you get a "functional decomposition". In an OOP language, you get an "object decomposition". It's what your program structure looks like.

Ruby supports those things, but IMHO provides a sort of "grammar decomposition". Writing programs and libraries in Ruby tend to look like writing new programming languages.

Python tends to produce a "practical decomposition", or a procedural decomposition. Yeah, you can make classes and functions, but actually doing things is valued more than structuring things.


👤 phendrenad2
[delayed]

👤 tptacek
Serverside Javascript split the vote for fancy web development. Ruby never really diversified meaningfully out of webdev, but Python has always had other major constituencies. There are powerful arguments to do server work in Javascript (single language), and not so much in Ruby, so in the late 2010's Python became the most pragmatic option for non-Javascript serverside web dev.

Another way to say the same thing: Ruby's fate is tied to Rails, and Rails put down a lot of bets that haven't been clear wins, most especially about the relationship between frontend and backend webdev.

I don't think Ruby's going anywhere, though I'd probably default to Flask for a new project. There is a lot of Rails out there.


👤 alfor
Python got traction earlier and is easier to pick up.

Then it became the new Perl, the glue language to avoid C/C++, that created an ecosystem of reusable libraries: numpy, then panda, then the deep learning stuff.

I started with python in the 2000, it used to be impossible to find job in that language, startups took python as their "unfair advantage" and it grew every year since.


👤 zmmmmm
I don't think Ruby is really even in the ballpark for comparison. It's almost a domain specific language for webapps while Python spans every single field and domain.

Now I really despise Python. It's the source of probably 80% of my day to day pain in managing a complex set of infra. It was just never meant to scale to the level of complexity in which it gets applied. And certain types of algorithms / logic turn into and incomprehensible unmaintainable mess when done using so-called "idiomatic" methods.

But as a language, its simplicity, transparent, direct and open design make it highly amenable for this sort of ubiquitous application in ways Ruby just isn't. Ruby is all about incorporating a large amount of knowledge of implicit behaviour into your mental model, and then it works great. Python is about knowing nothing. If you come to Python knowing nothing at all, there are probably 5 - 10 land mines to step on but after that its just "what you probably think it does is what it does" territory.


👤 cdchn
Python has the cleanest syntax around. "Executable pseudo code." Ruby had too much magic and other nonsense (:symbols, $igils are $tupid)

👤 peyton
BDFL contained bullshit during a critical period.

👤 javajosh
Python succeeded because it's well designed, and is now dominating because of AI. But JavaScript will ultimately win because software distribution is the most important hard software problem. And JS solved that problem.

👤 nsonha
Python is not simpler than javascript, its win data science is what lead to the popularity overal. Javascript standard and math libraries are still pathetic even today. Also js only started becoming a thing in the backend/desktop space after python gained traction.

Ruby doesn't have anything unique going for, its success as an "aesthetic language" can be easily copied by python, once it's become ubiquitos


👤 airocker
I had the fortune of working in a ruby heavy company after learning Python. I thought ruby had too many exception to rules compared to Python, python was more elegant. Every other win I think is a derivative of being a better language which in turn came from being a better community.

👤 jejones3141
I can only speak for myself, but Python struck me as much simpler to learn and understand than Perl. Also, my hatred for sigils burns with the heat of a million suns, going back to the $ suffix for string variables and functions in BASIC.

👤 heavyset_go
20+ years ago, Python was popularized as a general purpose programming language, and was used as a systems programming language for tasks that weren't CPU intensive. For tasks that were CPU intensive, systems programmers, who were likely already familiar with C/C++, could easily dip into C/C++ and back into Python again if they needed to.

This made Python a good glue language, and cemented it as convenient scripting language that can be used to do things at near compiled language speeds. This quality made it a good choice for scientific programming, where resource efficiency and language simplicity are valued. In that domain, you could have large datasets that need to be analyzed by researchers who are not developers.

If we go back to late the 2000's and early 2010's, Python was popular as new programmers' first language, while they learned Java/C#/JS/etc for school or work. At that time, some of those languages didn't always have the modern pleasantries they have now. Python very much had the reputation as being "executable pseudocode" in contrast.

You had developers writing a ton of verbose Java, C# and JavaScript at work, but also had a preference for the simplicity of something like Python. You had new developers with Python experience under their belts, as well, as the Python community was/is very focused on helping beginners. When developers come from Spring to something like Flask, it can feel like a breath of fresh air, and it became popular in the web development space as a backend language.

On top of that, Python is older than JS and had a mature library ecosystem. If you needed to write code against an API, use an algorithm or data structure, someone somewhere probably wrote a Python library for it.

As a result, you had a lot of people saying good things about Python, using it in their free time, and contrasting the language with contemporary popular languages.

The data science and ML booms forced organizations to adopt Python if they hadn't in the past so they can work with data and models, and they were incentivized to publish their own Python libraries so that other organizations who adopted Python for the same reasons could integrate their products/services.


👤 timinman
My impression was that node took some of the momentum that Ruby had as a server-side language for web development.

👤 anon373839
Around 2010, I recall that a lot of computer science departments in the US made a switch from using Java to using Python as the first language to teach programming concepts. So a large number of students were exposed that way.

Also, a number of top-tier websites (YouTube, Instagram, Dropbox, Netflix) made Python a central part of their stacks.


👤 femto113
Since I haven't seen it mentioned I'll throw out the Rails/Merb split in the late 00s as a significant momentum killer for Rails (and, by extension, Ruby). Rails 3 reunified them but I don't feel like it ever fully recovered it's developer mindshare, and the timing was such that it really opened the door for rivals like Express (Node) and Django (Python) to gain traction.

👤 cvalka
Because ruby is perl 2.0

👤 Kapura
Very little to learn in terms of key syntax + a lot of Real Words allows it to be an approachable scripting language for non-computer-specialists. The library ecosystem allows it to be used broadly, but it's not unique in this regard. It just happens to correspond with a huge boom in accessible computing resources & a desire to use them in a variety of fields.

👤 stasge
Reading the comments makes me wonder why where perception of Ruby that it is complex or hard to learn is coming from. Let's talk about just language without external libraries, package management or context of specific software.

I'm using both Ruby and Python for tooling (so there is neither Web nor ML context. Neither meta-programming). When it comes to Ruby I learn one thing and safely extrapolate, i.e. you don't need to learn all of the language to be able to use it. With Python I've had to come to the docs many times to understand how a particular thing works and I keep finding ways to shoot in my foot. This includes very basic stuff like variable scoping (global, class, instance or local) or type non-obvious type conversion (in Ruby only nil and false are treated as false in conditional expressions, while in Python this includes empty string, empty list, empty dictionary and so on).

When it comes to readability in Ruby it is natural to do data processing by "pipelining", e.g. you don't need to do f1(f2(f3(f4(data)))) (which is often the case in Python) and instead you can do data.f1.f2.f3.f4 which is easier to read. Classes, objects, inheritance work and feel a lot more obvious. Ruby allows to be concise without sacrificing (for example "a = 5 if seta == true"). Overall Ruby allows to write more readable code than Python.


👤 oaiey
IMHO, Python was already in the Unix/Linux university IT fighting perl into the background as operating system scripting .. that was at least my first contact .. and when then the universities looked at something more simpler than Java, Python was already everywhere in their sysadmins hearts.

The space was not that crowded back then: Go/Rust did not exist, C# was Windows only, Perl was a mess, PHP was web only, Java was hated, Lua a niche and C++ too low level. And JavaScript was that slow thing in the desktop browsers. It was python or ruby and python like said was on every system and ruby the exotic thing.


👤 TrackerFF
Beginners and non-coders find it really easy to start with, because so much code reads and writes like psuedo-code.

The middle-ground coders - i.e. those that mainly use programming as a tool to solve some specific problems - but rarely delve into full-blown software engineering projects / complex programs / systems programming / etc. found Python to be really easy due to all the provided libraries, and lack of boilerplate code.

The "true" programmers use Python for smaller projects, like proof-of-concept / prototype work, and then continue in a language that's easier to work with as the codebase grows.

Of course, there are many more beginners / novices that will only briefly touch Python, than seasoned pros, hence the rise in popularity. Python is no longer scaring away people from coding.


👤 fghorow
I'm a scientist with an extensive scientific/numerical computing background. I was taught PL/I as my first language.

My "load bearing" language path was Fortran -> (Forth) -> C -> C++(YUCK!) -> Python/Numeric/Numpy/scipy/et al.

I'm now dabbling with Julia.

In addition to Numpy (and it's predecessors) making array computation dead easy to express (slices!) for me personally it boiled down to Guido having taste that matched my own.

I'm sure that YMMV...


👤 theodpHN
How about Big Tech and The Cloud? Certainly didn't hurt that the tech giants embraced and helped extend Python. Python's Guido van Rossum has been an employee of both Google and Microsoft (with a stint at Dropbox in between). Visionary Python Foundation sponsors include Google and Meta, while Microsoft and NVIDIA are Sustainability Sponsors, and AWS and Salesforce are Maintaining Sponsors. The Chan-Zuckerberg Foundations is also a big funder and user of the Python ecosystem. For Cloud companies and their big customers, Python's price ($0) is certainly more attractive than commercial software if you need to run software on a sky's-the-limit number of processors.

👤 rtpg
Disclaimer: Pythonista

I had an opportunity to be exposed to Python and Ruby at roughly the same time.

Python the IPython notebook had started showing up, and the dust had settled a bit on the Py2 -> Py3 transition. So while I was working on a Python 2 codebase, the general vibe of the community was "let's not break more stuff". Pseudocode -> Python translations were pretty straightforward.

Ruby, the entry point was Rails. I bought books on Rails, could not for the life of me figure out how files got noticed by the project or not. I wanted to do something like passing in a function, went on an IRC channel, got yelled at for not doing things the "Ruby" way. Lots of "clever" methods on objects that were neat but didn't really look like pseudo code.

My experience was deeply coupled with Rails, and I think in an alternate universe where I was using Ruby for scripting I would have come out with a different feeling. But Python mostly had no blocking issues for me (a person who was programming for a while at that point), and Ruby was a bit of an undecipherable thing from an operational perspective (even if I could look at a code fragment and understand how it worked).


👤 slowhadoken
Native math libraries, strong types, great performance for a dynamic language. The writing was on the wall ten years ago. Big data and then neural networks. It’s all math, abstract math, and computational math.

👤 anon291
Python is popular because google used it. At the end of the day, the consistent thing that makes languages succeed is consistent corporate backing and money. Now, as to why Google chose it for their internal tools, we can talk about that, but if the question is why did python win, it's obviously because google made it a big part of their stack.

👤 segmondy
I started programming python in 98. It won because before that, Perl was king. Have you seen perl?

Python made a great decision, it was the anti perl. One way to do things, keep the syntax easy and simple. Force whitespace indents. Before python got really "pythonic" It read like pseudo code. As someone that explored Ruby for a bit, Ruby has too much magic. Magic is cool when you're the one casting the spell, but for your audience, it's annoying if their job is to figure it out.

It offered OOP, but was like C++. It didn't force it on you. If you came from a C background, you could write C like code. If you came from an Objects/structs background you can do OOP.

It then offered a great standard library. It had a REPL. DO NOT UNDERESTIMATE THE REPL. Not just a basic REPL, but an interactive one. dir()? __docs__? The power of man pages built into the REPL, allowed one to explore an unknown library.

Say what you want, but the FFI was well thought out and embraced. This made it possible for lots of C library to be made available in Python. PyQT, wxPython, allegro, OpenGL, all these paved the way for NumPy,TensorFlow, PyTorch. Your favorite graphics, sound library and many other libraries where wrapped in Python. You didn't have to write C anymore for most people with computers being fast enough.

Python won because of many little correct decisions along the way. The python2 to python3 drama was not a nightmare like perl5 -> perl6 or VB to VB.NET. Many good little decisions with a big of luck helps.


👤 slantaclaus
Python won so much that your post questioning it and (gasp) supporting Ruby has been greyed out with downvotes

👤 MengerSponge
Python won by being delightful. Lots of programming languages are delightful at some stage of mastery. BASIC is delightful when you are just getting started, and JavaScript is delightful once you have a deep mastery of the language's subtleties and footguns.

Python is delightful once you get off the ground, and before you've made anything too complicated yet.


👤 User23
Because worse is better.

👤 vijucat
I've been trying to teach my daughter (11 years old) Python and she gets quite confused by the whitespace-as-indent construct. For example, it's not at all obvious when a block ends and you have to unindent / go back to a lesser level of indentation. Flower brackets (C, Java, etc;) or explicit ENDIF are much better. This course [1] is quite good for kids of that age.

And, oh. Just realized that self.name (object.variable) quietly retrieves the Class.name class variable (class "attribute" for the pedantic) :|

Hate how dynamic languages bend over backwards to not report an error. I would much prefer the "inconvenience" of having to compile my program and then be told what all is wrong at compile time. Sad that this is now popular. The language is very adhoc in general.

1. https://www.udemy.com/course/real-world-programming-for-kids...


👤 strzibny
I agree with you. I even remember it. It was Ruby or Python. Rails or Django. I tried both and liked Ruby and Rails better. Maybe if I knew back then it will be number one language I would go for it for the sake of career. But I still think that Ruby and Rails are better, and are my daily driver.

👤 mulmen
“Perl is worse than Python because people wanted it worse.” - Larry Wall

👤 dboreham
Python is much older than Ruby in terms of wide adoption.

Python became popular because: if you want to write a program that runs from the shell, uses file I/O, terminal I/O and possibly network I/O, that's quick and easy to work with, and where the runtime is either already on your computer or can be installed painlessly, there weren't many alternatives.

Shell script is too crappy a programming environment for anything non-trivial. Perl is a mess. Ruby isn't on the machine and is (still!) a nightmare to install. Compiled languages are not quick and easy to work with. JS doesn't exist yet (in a form usable from the shell). Tcl is too niche.

Python is the least worse choice.

All the stuff about ML and stats and Jupyter and what not is not relevant -- that came later as a consequence of Python already being popular.

It's actually amazing that Python is still popular because it nearly shot its own feet off with the 3.0 nonsense. Most folks here probably don't even remember that...


👤 laran
Ruby was popular by accident. Rails was popular because it was valuable.

Rails was ahead of it's time. The alternatives in that era were ... well, they aren't around any more. Rails was to the alternatives what an iPhone is to a flip phone.

Python is useful with a low barrier to entry. It's valuable and available. It isn't competing with anything. It's useful in the way that spreadsheets are useful.

Just as databases didn't "lose" because spreadsheets are more widely used, neither Ruby nor Python has won or lost. Python is more useful in high-value areas, particularly data science. And ruby is still more fun.


👤 unethical_ban
For me, it was python available on the base Linux install at work. Along with Bottle.py it meant my team could build internal web apps and host them without asking IT for additional software installs like apache.

If ruby had been there with a ruby micro framework available we might have used that.


👤 twangist
Neither Python nor Ruby is "English-like", and neither wishes to be. AppleScript is English-like, COBOL is English-like.

👤 hkt
I was writing both about ten years ago, and ditched Ruby with great joy after wrestling with dependency management. It isn't great in python, but Jesus, it was awful in ruby. I haven't bothered writing in it since.

👤 greenthrow
Your view of history is not accurate. Python and Ruby were not really competing back then for building web apps. The most popular languages for that in the 00s were Perl and PHP. Ruby on Rails came along and became popular for a while and some popular sofware was written with it.

But Rails based apps then quickly developed reputations for performance issues and for managing gem dependencies being a nightmare. Then Node came along and was the new exciting thing. npm was easier to use and a lot of people jumped on that for a while. It was exciting because most of us were already fluent in JS. So it was just using a language we knew in a new context rather than picking up something totally new.

Why is Python the soup du jour lately? Well it has been around for a while and has a reputation for being mature and having mature libraries. It also became the best language to hire junior devs because of its ubiquity in US universities. Even if you don't go into CS as a major or minor there's a good chance of getting exposed to Python. It also has some advantages for collaborative codebases like the language itself being opinionated on formatting and having lots of well developed tools.

Is it the Right Choice(tm)? I dunno. It definitely has downsides as well. But every team has to decide for themselves, and not all good reasons are technical (eg the larger pool of junior devs today than say, RoR.)


👤 gwbas1c
Back when I read the O'Reilly book on Ruby on Rails, it liberally referred to "Why's Poignant Guide to Ruby."

That's when I realized something: The book, and thus Ruby on Rails, appealed to teenagers as their first programming language.

Teenagers get very passionate about things, and emotionally involved with their choices.

Python is a tool. Good tools are boring, and don't come with references to bacon and other grammatical jokes. They are about performing a task; and they don't need to entertain in order to keep a teenager's attention.

I look at RoR as a way that many young people got excited about programming, but not really the best tool for the job. It deserves a place in history next to Visual Basic, because it met people where they were and allowed them to build something "good enough" when other tools were too difficult or time consuming to use.


👤 nstart
If you think about it from the perspective of people learning programming, python is dead dead simple. In Unix like systems it comes preinstalled most of the time. For so many students in many parts of the world who use an HP/Lenovo laptop for university work the OS is windows and python installation is again, dead dead simple.

Ruby starts off by saying you should have a version manager. And windows installation is not straightforward (from a student perspective it’s important to note that something that looks like it isn’t officially supported makes it feels like the entire language is going to be a compatibility slog). This is not dead dead simple. It’s not hard. But it requires more than one concept to be learned to start.

Then the docs. Ruby has so many ways of getting started. Python puts up one main way. Same for the api reference. Python has a single link and they even say “keep this under your pillow”. As a beginner I know what I should do. Ruby? Many links that say arcane stuff (beginner perspective) like rdoc and what not. Python is super clear in their breakdown of reference too. I cannot stress enough how simple this page (https://docs.python.org/3/library/index.html) makes it to find what you want.

Overall Ruby and it’s documentation feels like it’s made for people who know Ruby or something more than the bare minimum. Python is made for people who’ll be trying out programming itself for the first time.

To me, that’s what made Python win. They just seemed like they thought more about folks starting out for the first time.


👤 zerkten
I look at it in the following way:

- Ruby and Rails are joined at the hip in a way that Python isn't. While Ruby is a general purpose language, it was only strongly adopted by web developers.

- Rails didn't have a competent deployment story initially. It was a pain to deploy and run mongrel relative to other platforms and this only seemed to get effort after the first RailsConf. The impact of this was primarily on enterprise developers who might have gotten adoption to a higher level.

- Speaking of the first RailsConf, DHH did everything possible to undermine potential advocates within the enterprise space where lots of Java refugees might have helped with adoption. ThoughtWorks backed Ruby and Rails, but there are quotes from Martin Fowler like:

"A couple of years ago I wrote about the impressions people had that the RubyPeople were notably more friendly than most software communities. Talking to people at RailsConf I got the message that that had changed for the worse. Both the ruby lists and particularly the rails lists had tended more towards the sad Internet mean. In his opening keynote Chad Fowler said that the rails community had a reputation as "a bunch of arrogant bastards" and I cringed as an, admittedly small, group raised a triumphant cheer." (https://martinfowler.com/bliki/RailsConf2007.html)

- The community was very anti-Windows which stifled adoption. The default developer machine now seems like a MBP, but it wasn't in 2007. Rails got lots of attention around the time of the Intel transition so this was a cool time to have a Mac. A PC was only usable for Rails work if you put Linux on it. Some people realized you needed better basic Windows support to run Rails for development, but it wasn't a priority. Again, this limited potential web adoption.

From this you can see a repeated pattern of mistakes which would have at least increased Rails use in the enterprise market. It was strongly adopted in startups and niches within enterprise that IT didn't control. There was no real reason to discourage this community of developers who found Rails a nice fit for what they were building.

Now Python:

- The Python community specifically targeted diversity and getting adoption in first programming classes in colleges. This was an active effort that accelerated things at least as much as use in data science. The fact that everyone was being taught Python as a first language even if they'd go the web route was a huge boon to cement it within the data science perspective.

- In the previous point I called out diversity because it was a key differentiator in getting it everywhere. Not everyone stayed in the community, but they stayed at a higher rate than Ruby. People will want to discount this because they feel it's political or woke, but it affects the TAM. I don't think you can substitute "friendly" because they knew that wasn't sufficient.

- Python has had stronger Windows support. The effort was inconsistent over time, but it existed and wasn't discouraged to the degree that it was for Ruby. Companies like Active State where popular long before Anaconda appeared on the scene.

- Packaging in Python is a disaster zone, but it's been good enough to get adoption.

- Google gave credibility to Python at a time when it was competing with Python. This swayed non-devs in decision-making roles to an extent. Importantly, Python hasn't been wed to one vendor. When Google dropped, other stepped into the fray. It seems MS are quite involved today.

- The transition from Python 2 to 3 is viewed as a misadventure by many. It did this and still won out. If you rewind to PyCon 2009/2010, the vision shared by Guido was for a long term transition with some degree of experimentation. People have forgotten, or joined late.

- Data scientists have taken over the Python community, but Django and Flask are still pretty sizeable communities. This diversity is a strength and the community is open to experimentation.

- Python performance doesn't suck much more than Ruby for the most part. If Python had disadvantages to a peer like Ruby, it may have had an impact. Instead, people inside the community complain and stay, or they peel off to Go/Rust/C#/Java/Kotlin (any faster platform) at a slower rate than you might expect. Yes, whole teams/apps drop it wholesale, but what matter is the overall number. I think this is more of a concern today (like packaging is) than it was in the key period of 2006-2012 when the battle was fought.


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


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


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

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


👤 ronreiter
Python came way before JavaScript became good. And today it is on the way to lose as a back-end language to TypeScript and Golang.

👤 sam0x17
The real reason python won in my opinion is it has been a default install on most linux distros for decades. A ton of the groundbreaking ML research (especially in the 2000s and 2010s) was done in government labs and DoD settings where it is extremely difficult to get external software approved/installed, yet there was python sitting there already installed on every single DoD Red Hat machine. So a lot of research code ended up getting written in python as a prototype and then improved with C++ in the speed-sensitive bits, and before you know it, Python = ML.

Being a default install also has a lot of barrier-to-entry advantages in other settings, particularly in academia where there are similar (but usually not nearly as strict) bureaucratic restrictions on installing things, etc.

source: was a DoD computer science researcher focusing on ML for several years and witnessed people reach for python because they were still waiting for months, sometimes years for whatever software package or language to be installed / approved by security/IT and had no other dev tools


👤 bjt12345
From my experience back then, it was about the libraries, not the language. I think this still is the case today.

Back in the day, Perl had all the libraries and they were easy to install and worked well, then Python overtook this had all the libraries. Ruby never really had enough libraries to compete against Python.


👤 hiAndrewQuinn
Python was the first language I learned, way back in 2010.

Between 2010 and now, among "backend" languages I've picked up and played around with there's been Java, C, C++, Haskell, Scheme, Racket, Prolog, Forth, Go, C#, and Rust. You could throw bash, JavaScript and Verilog onto that pile if you want extra oomph - and indeed I switched from bash to fish last year, because it was just a much better language.

So when a tool shows me a decisive advantage, I do switch. But nothing so far has done so for Python for me. I just don't see any decisive reason to switch when I already think in Python.


👤 stevebmark
Python didn't win, but it is popular in the data / ML / AI territory, and that ecosystem is attracting lots of developers. It's not about the quality of the language.

Ruby is everyone's favorite toy: Fun to play with, and you shouldn't do anything serious with it.


👤 zgs
In what way is Python a titan? It's a nice enough language & I've done real world projects in it.

Lua is simpler and, with LuaJit, much faster and far more C compatible.

C is still very widely used and generally comes above Python in the "best" language lists.


👤 joss82
Python won because it's a good and versatile programming language, in the sense that it can do a lot of things well. AND it's the fastest language to learn, if you know English, because it's the programming language closest to English that we have. Until AI allows us to program in English (or any language for that matter) directly.

I started doing Python 15 years ago for game development (using Pygame) and it was fairly good at it. At least for prototype, side-project games. Coming from C, the syntax wasn't hard to grasp.

Then I tried it for web, coming from PHP. It was good at it too. I could reuse some of what I learnt in the previous step.

Same for AI, now I can dig into it and only learn the AI part. I don't have to learn yet another new language. And it does the job here too.

Python won because it has the least amount of friction at every step.


👤 williamsmj
This article makes a good case that its takeover of the data and ML ecosystem is a symptom, but the root cause is PEP 3118: https://jeffknupp.com/blog/2017/09/15/python-is-the-fastest-....

👤 rusticpenn
MATLAB made their software paid for research organizations. Many including Fraunhofer moved to python as an alternative.

👤 est
> My impression is that in the ‘00s, Python and Ruby were both relatively new

Contrary to popular belief, Python is older than Java.

> math libraries, numpy and pandas make it appealing to academics

The most important factor: these libraries are free.


👤 qwertox
I started using Python because of Google Wave. Initially stayed with it because of Google App Engine. Before that I was only using C++ for over a decade. When I stopped using GAE I stayed with Python because I noticed that it is such a good tool to easily solve problems, be it managing the OS, building servers and clients, collecting and analyzing data.

I've always used Javascript and have been using a bit of Rust lately.

But I guess what made it "win" lately is IPython/Jupyter and Conda, which enables non-programmers to use Python as a language to express and solve their problems, like Mathematica or MATLAB did for mathematicians and engineers.

So I guess that Google added a bit to its popularity.


👤 fractalb
The first time when I heard about it (in 2009), the talk was that Google was using it internally. And it was the first language to be supported in their AppEngine platform. And Django was solid. These were the things that helped Python, in my point of view.

👤 sterlinm
Pandas, Django, and Flask.

👤 ivolimmen
If you like Ruby I think you might enjoy Crystal as well.

👤 marmakoide
The language itself is decent enough for seasoned programmers, accessible to beginners, copy-paste friendly and the ecosystem covers the recent popular needs and hypes.

👤 davidelettieri

👤 flohofwoe
For me it was the cross-platform batteries-included standard library, which could completely replace Windows batch files and UNIX shell scripts with a single solution that was also much more convenient to write. At that time node.js was still a decade into the future.

Today I'm starting to move from Python to Deno though. I'm still fed up with how bad the Python2 to Python3 transition went, and Python3 has all the wrong goals for what I'm using it for (it tries to be a "real" programming language, when I just want a cross-platform scripting language).


👤 stuaxo
Python is easy to embed in C programs, so found its way into just about anything that wanted a scripting language.

This is before all the current machine learning stuff.


👤 tasubotadas
Operator overloading + great interop with C - the ultimate cross platform (and most popular) language

Great standard library (Javascript still doesn't have one). Even better than Java's

Cross-platform

Interpreted language with minimal environment needs where just having python.exe is enough (compare build systems C or Java, or environment setup needed for PHP/perl)

Great DX given how simple core syntax and standard libraries are (again, compare with perl magic, or PHP madness)

Early numpy/scipy packages found amazing uptake in science community which acted as evangelists. This happened to great DX (scientists don't like coding C) and great C support (they still need C speed)


👤 deaddodo
> My impression is that in the ‘00s, Python and Ruby were both relatively new, dynamically typed, “English-like” languages. And for a while these languages had similar popularity.

Your impression is false. In the 00s, Python was a slowly growing language that had a few niches that it was extremely popular in. Meanwhile Ruby (well, Rails in particular) was the Next Big Thing and immensely popular, especially for new Web Applications.

What happened is that Rails' schtick got less unique as more MVC frameworks were created for other languages (CakePHP, Laravel, Django, etc) and Node was released. JavaScript/TypeScript has filled all of the same areas Rails used to and is even more accessible so is the new Next Big Thing. Meanwhile, Python just continued steadily growing and a few of it's niches have become very important to businesses (Data Science) and the tech sphere, in general (Machine Learning); exponentially increasing it's uptake.

So, while RoR is still very popular in web shops, it's more common to be seen in legacy codebases (3-5+years or older) and less so in newer ones (where Node/Deno has taken it's place). Python, on the other hand, is very popular in two very greenfield spheres that are continuing to grow fast.


👤 takeda
As someone who learn about those two in late 00's when they both still were and Rails was hot.

I believe it was because python prioritized terseness and at the same time readability, while ruby prioritized cleverness often it was harder to understand someone else's code or even your own after a while.

That was at least the reason I avoided ruby, it felt like a descendent of perl.


👤 sharts
Python had been around much longer than that. But it was mostly in the realm of scientific things.

Ruby became popular when Rails exploded and everyone got into Web 2.0.

Lots of other frameworks came out after that and there was no other killer Ruby apps. But that doesn’t mean that the Ruby ecosystem weren’t doing great things. Just no “big hits”.

Computer Science departments started offering their intro CS classes in Python instead of Lisp. So it is no surprise why it exploded.

A lot of Ruby-ism has found itself in Elixir. Which seems to slowly be gaining traction.


👤 grigio
first mover advantage