Lurker News
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).

Comments (828) 243 threads

r_thambapillai31 replies#
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.

paulddraper1 reply#
> In that space, it had no competitors.

Well, there's R.
But basically, yes that's the long and short of it.

jacurtis1 reply#
Or Julia, a language custom designed for data science.

Also, MatLab was the go-to before Python took over the scene. So it definetely has competitors.
Python's strength is that it is the "jack of all trades" language. Its not the best at anything but its pretty good at everything.

webel0#
Julia is much younger.

Matlab is closed source. I haven’t touched it since I had a uni license.

masklinn1 reply#
> Python ended up 'specializing' in data contexts, thanks to Numpy / Pandas

Yeah it was a success 20 years in the making, had a fair amount of input from science men and that being GvR’s background he responded positively e.g. the extended slices (striding) and ability to index with an unparenthesised tuple (multidimensional indexing) were very much added for the convenience of numpy’s ancestors.
I would not say it had no competition, Perl used to be quite popular in at least some sci-comp fields (I want to say bioinformatics but I’m probably wrong).

cutler1 reply#
Why probably wrong? Bioperl was very big in the bioinformatics world.
masklinn1 reply#
> Why probably wrong?

Because I don’t have a great memory and I was never into Perl so I was extremely unsure of the suggestion and didn’t want it to come across as an assertion.

Continue this thread — 1 reply

inasio#
Maybe it all came down to the decision to fuse python's Numeric and Numarray libraries into Numpy, providing a unified "fast" Matlab-like library, which ended up being a great fit to a lot of datascience use cases.
qsort9 replies#
Numpy is certainly amazing, but there are tons of competitors in the data/scientific space, which pure "A-type" data scientists tend to prefer: R, SSPS, Matlab...

The difference is that Python doesn't entirely suck as a general-purpose language. Sure, you might have better options, but it's still reasonable to write almost anything in Python.
Other scripting languages like Ruby, JS and Lua are probably a little bit better when evaluated strictly on their merits as programming languages, but they lack the ecosystem.
In other words, it might be inelegant, slow, a mess, whatever, but the concept behind it is basically correct.

TuringNYC1 reply#
>> R, SSPS, Matlab...

I'd immediately throw out "competitors" that cost hundreds of dollars to use. https://www.mathworks.com/pricing-licensing.html Academic pricing is $275/yr and normal is almost a thousand a year. Then you pay for modules on top.

ImaCake1 reply#
Yes, and this is why R has become so dominant in the data and statistics spaces. R is free, and has gained so much momentum that it often has packages that no other language has. Yesterday I found out that there was just no way to easily reproduce mgcv::gam in python. There are loads of similar examples.

As someone who likes both R and Python, and had the misfortune to learn Stata; I am very glad to see R winning over these expensive dinosaurs. Maybe one day it will even displace matlab!

Continue this thread — 1 reply

deadmutex1 reply#
Matlab costs $$. Matlab was ahead in perf for a long time, not sure now. E.g. they used to JIT code, etc.

Comparing python to R, python feels like a much more mature language. R always seemed only useful for small scale projects, e.g. writing some script to process data with < 20 lines of code. Python codebases just scale much better.

kstrauser1 reply#
It also has the nice feature of being good at multiple things. If you get a model running in Python, and decide you want to be able to run the code via an API, put it behind Flask and ta-da!, now it's a network service.

It's not the best way to write analysis code, and it's not the best way to write a web service, but it's probably the best way to write analysis code that runs on a web service.
I picked web services as a random example, not one I'm particularly passionate about. But as a general trend, if you want to combine 2 unrelated domains, Python probably has you covered better or more easily than just about any other language.

Continue this thread — 1 reply

dekhn5 replies#
numpy exists (somewhat indirectly) because matlab cost $$$. and now numpy is a far larger use of matlab's concepts than matlab will ever be.

I haven't seen anything an "A-type" data scientist needs in R/SAS/SPSS that was intrinsic to the language and couldn't be ported to Python. I don't want a "data/scientific" language, or a "web" language, or a "UI" language- I want one language that explicitly supports all the usecases well-enough.

qsort8 replies#
> I haven't seen anything an "A-type" data scientist needs in R/SAS/SPSS that was intrinsic to the language

Not intrinsic to the language but in terms of the ecosystem, for a purely A-type data science workload R is significantly better. dplyr + ggplot vs. pandas + matplotlib isn't even remotely close.
Now, obviously in the real world nothing is ever purely model work, which is why Python more than makes up for the difference.
> I don't want a "data/scientific" language, or a "web" language, or a "UI" language- I want one language that explicitly supports all the usecases well-enough.
Me neither. *taps sign*
>> The difference is that Python doesn't entirely suck as a general-purpose language.

Continue this thread — 8 replies

fluidcruft3 replies#
Matlab has a more interesting dispatch model than python though. (Mathematica has even better dispatch but I haven't used it in almost 20 years at this point) Julia's model is even better, but I just never have time to dig into it deeply enough to get to the zen of Julia. One day when I have time to understand Julia I'd like to, but it's hard to compete with the reliability of python just always working.

Continue this thread — 3 replies

BlueTemplar3 replies#
Well, why didn't the free alternatives to Matlab like Octave or Scilab win out then ?

Continue this thread — 3 replies

bigger_cheese#
>I haven't seen anything an "A-type" data scientist needs in R/SAS/SPSS that was intrinsic to the language and couldn't be ported to Python.

I don't know what "A-Type" is so I might be misunderstanding you.
For SAS at least in my Org what keeps it entrenched is Enterprise Guide and the associated environment. Having a drag and drop GUI to do the data extraction and manipulation and the analytical tasks makes it very easy for non experts to be incredibly productive. The people that use it here are Engineers (Non-software variety) and Finance accountant types. These people would not be productive writing python code (or R) but still need to use something heavier then excel for data analysis.
Over the years we have chipped away at parts of SAS with things like Power BI and Azure ML Studio but I don't see python playing in the same space.

mr_toad#
> and couldn't be ported to Python

“Couldn’t be” is not the same as “has been”. If R has a package that Python doesn’t, I’m not going to port it to Python, I’m just going to use R.

CuriouslyC1 reply#
Some industries are stuck on matlab (jet propulsion, for example) but in general people from sciences are either Python or R, and SAS/SPSS are only really used in places like health care or pharma where there's a lot of regulation in place, because the software is designed around that regulation, unlike Python and R.
dimask#
It is also still quite dominant in neuroscientific fields, as there is a lot of software and code there from the past, but it is changing little by little.
karmasimida#
Anyone who used Matlab to process text before 2015 wouldn’t consider it anywhere closer as a competitor to Python

Same goes for R/SASS
Python has no competitor in terms of the whole package, it is a full featured language while being particularly good at data

nl#
This is a good point.

I've done a fair bit of R and there is no doubt that as a pure data science tool it's usually quicker to produce something than Python.
But I prefer Python because inevitably any data science project ends up having other "bits" that aren't pure data science, and Python's super string general purpose computing libraries are hard to beat.

twobitshifter1 reply#
I would just add that for scientific scripting Julia is usually nicer to program in than the combo of numpy and Python. Julia is fast enough on its own that you can do the matrix calculations directly and it supports real mathematic matrix operators. It’s also a great type based design that makes using packages magical.
gaganyaan4 replies#
I think Julia has a hard uphill battle against the "Python is the second best language for anything" effect. Julia looks pretty cool to me, but I already know Python. I'll probably learn more about it in my spare time, but I'm also never going to be able to convince my coworkers to try it out, because they also know Python and that's good enough for them. And thus Python's dominance continues.

Continue this thread — 4 replies

Continue this thread — 2 more replies

Continue this thread — 27 more replies

AdamH121138 replies#
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

sgt#
Good memories. I still have that issue in the attic somewhere.
dale_glass2 replies#
I think a good part of the issue is that right around then, Perl decided to do Perl 6.

People decided to wait on doing anything big, since Perl 6 wouldn't be quite compatible. Later it turned out to be extremely incompatible. And Perl 5 would be dead long term, so why spend time on it, when you'd have to do a radical rewrite soon?
Meanwhile, Python was there.
And Perl 6/Raku took 15 years to finally arrive in some form, by which point Python had completely eaten its lunch.

AdamJacobMuller#
Perl 5 to Perl 6 transition took so long that python had it's own internal crisis with Python2 -> Python3 transition inside of that (and handled it far better).
cutler#
Plus Perl6/Raku is still dog slow compared with Ruby/Python/Perl5 by a factor of 10 when parsing a log file with a regex.
MatthiasPortzel#
This comment was very helpful.

Part of my question is why Python was used as a successor to Perl and not Ruby, but it sounds like Python was established as a competitive scripting language 5 years before people were talking about Ruby.
I can’t find it now, but there was another comment that pointed out that the languages weren’t contemporaries.

tootie4 replies#
I think it's kinda nonsense. No programming language is intuitive. It's arcane by nature. Having slightly more concise syntax saves you maybe a week of learning time. I used to write Perl about as fast as I could think because I had a lot of practice with it. I mostly do Python now, but do a lot less coding in general and I have to google syntax constantly. Python is less noisy, but it's not really more intuitive for me.

Frankly I think language design is secondary to IDE integration. The only time I've ever coded without thinking at all was using Java with IntelliJ or C# with Visual Studio. Type-matching and library introspection all work flawlessly 99% of the time. Not only do I not need to know the details of syntax, but I didn't even need to know APIs because I could autocomplete everything all the time. Python with VS Code still feels stone age by comparison.

aeonik#
Your point about statically typed languages rings so true to me. I learned Object Oriented programming on Java, then did professional C# with ASP.NET.

I changed companies and learned Python because everyone was raving about it on the Web. I was so confused when I started using it, I thought I had a misconfigured environment or that I was missing some libraries when I started writing Python.

skybrian1 reply#
Yes, Java has very good IDE integration, but for other languages, being easy to write without an IDE was important back then. A lot of people were using text editors.

The situation has changed now that having at least somewhat reasonable IDE integration is common. AI tools can also give you pretty good autocomplete.

tootie#
I am endlessly baffled by developer's preference for lightweight text editors because they never bothered to learn how to use a debugger. The last 5+ years of my career have been mostly node and python and the state of their debuggers is abysmal and even stack traces are always useless. Want to impress me with your programming language? Don't show me code, show me a stack trace when it fails.
lelanthran1 reply#
> I used to write Perl about as fast as I could think because I had a lot of practice with it. I mostly do Python now, but do a lot less coding in general and I have to google syntax constantly. Python is less noisy, but it's not really more intuitive for me.

Well, it isn't intuitive now. It was a lot better than Perl back in 2002 or so, when it really started taking off.
Now, a lot of serious Python code is simply incomprehensible.

tootie#
That's the time frame I'm talking about. Everyone got bent out of shape over Perl's sigils and built-in variables, but if you memorized the 20 most useful ones they save an enormous amount of time. If you name your subroutines appropriately and keep them short, code will be readable no matter what. Modern node is far worse than Perl ever was:

const foo = async () => {}

uglycoyote#
this resonates with me.. I fell in love with python because it made it really easy to write 100 to 1000 like I scripts that I could whip out in no time and make something happen. I still love it for that. But I fell out of love with it working on a large codebase -- mostly someone else's code -- where I felt imprisoned by not knowing the types of most function parameters, what I could do with those types, and what code I could change without breaking other code. The lack of ability to navigate in the way that I can navigate C# or Java killed python for me

I still have to use python though. I make an effort to type-annotate everything I see, and python's type annotation features keep improving, but it still often feels like an awkward uphill battle

Continue this thread — 4 more replies

moonchrome28 replies#
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.
Python was big before numpy/ML.

Continue this thread — 28 replies

zdw16 replies#
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.

Continue this thread — 16 replies

Load more comments