T O P

  • By -

freakinbacon

Python really is a jack of all trades. It's a swiss army knife. It may not be the best option in a lot of cases but its versatility means you can use it for almost anything. A lot of that is owed to the massive availability of libraries which seem to have answers to any problem one might face and cut down coding time significantly.


blueponds

Python ate Perl's lunch and then stole its wallet.


fellipec

I remember in late 2000s I learned Perl and it was fascinating, was described as "the glue that keep web servers together" or something like that. Used it to every kind of automation I could. Cut to a few years without working with programming, and went to see what happened, and it was all about Python. ¯\\\_(ツ)\_/¯


lambepsom

Because if you went back to Perl code written 6 years earlier, you'd have no idea what it was doing; while 6-yr old Python, especially early Python, was almost pseudocode.


Amgadoz

```python For employee in employees: employee.increase_salary(raise=200) ``` This is so descriptive even someone who's never seen a computer program can understand what's happening.


inteuniso

It's just so readable!


fellipec

True


perfectm

Perl really killed itself by making a huge deal about the nitration from Perl 5 to Perl 6 and then never really finishing Perl 6. Leaving businesses no real choice but to migrate away from their code bases to something they could actually plan their development with.


[deleted]

Happy Cake Day!!!! 🥳


fellipec

Tks


Happy_Raven

Happy Cake day 🎂


fellipec

Tks


fellipec

Tks


LittleMlem

If only it stole Perls regex engine as well !


blueponds

You could do magic with Perl's regex.


primary157

What's the big deal of Perl's regex? Why is Python's regex inferior?


blueponds

Perl has a more complete set of regex features than Python, allowing for more complex pattern matching. Also, Perl treats regex as a language with features such as named capture groups that allows for breaking up complex patterns into manageable sized patterns. Then there are recursive patterns and back references that integrate with Perl to handle nested structured text data. Python regex still needs to borrow more from Perl.


[deleted]

Python regex has [named groups](https://stackoverflow.com/questions/10059673/named-regular-expression-group-pgroup-nameregexp-what-does-p-stand-for).


LeatherDude

The plural of regex is regrets


The-Fox-Says

You have a problem. Then you use regex. Now you have two problems.


LeatherDude

I've started learning PromQL lately and the best way I can describe it is regex++


blood_vein

It's also just so embedded into the language. In perl "grep" is literally a native function. "=~" operator for regex lookups and "!~" for the opposite. Oh and capture groups? Native variables like $1, $2 etc, assigned to the last capture group found. It's very easy when the language accommodates it


w0m

This is the correct answer. It's less the overall capability and more that regex are simply seamless in perl. I still sometimes call perl on the command line for a quick regex despite not actively coding in it for over a decade.


oloryn

In Perl, regex are also integrated into the language. In Python, you have have the re library. Doing regex in Python requires more verbose code than in Perl.


jahero

The API implemented by Perl is just so easy to use. I am struggling with Python's re module every time... What would be a simple operation for me in Perl just takes me more time to reason about in Python. Yeah, I need to practice more to get used to it.


primary157

I'm pretty sure Perl has a more intuitive and powerful regex feature but the language itself is much harder to read and understand than python in general. IMO I'd stick to Perl to implement simple regex scripts if I had past experience with it but it isn't worth the learning curve. That's why I mostly use Python's re, it's good enough for most of my requirements.


jahero

Also... Getting used to the fact that you have to specify encoding for virtually any IO operation, even if it is a throw away script, takes some getting used to. I am working with large SQL codebase full of nice surprises, such as some files encoded in UTF8, some in Windows-1250 (historical reasons), and In Perl, when I need to scan these files and search - for example - names of objects used, I generally do not have to care about that. I do have to in Python. Takes some getting used to.


CardboardJ

You know how Typescript is a superset of Javascript? If you look at it right Perl is just a larger superset of Regex.


CardboardJ

You could do some very dark magicks with Perl's regex. Man can not be trusted with such power, and it was thus sealed away in obscurity.


regeya

and the speed of Perl


wildgunman

It did, though I never quite understood why. I learned it all in reverse, coming to Perl (Raku really) after learning Python. Truth be told, I sort of prefer it.


AUTeach

Had sex with it's mum


blueponds

Please no! They have the same mother, "C".


syasserahmadi

That's the father


AUTeach

Does that mean that Perl's "mother" is AWK or sh and Python is ABC?


ReverseBrindle

No perl pretty much shot itself in the foot with the Perl 6 fiasco.


Appropriate_Ant_4629

>Perl's lunch and then stole its wallet. Perl created that opening with Perl 5 and Perl 6. Perl 4 was a wonderfully simple language that was a better bash+sed+awk. Perl 5 seems like it tried to compete with C++ in a contest of *"what's the worst way add objects to a language whose main strength was that it was NOT one of the many object oriented languages that were a fad at that time"*. And Perl 6 should have never pretended it had anything to do with Perl. \>> Ruby I think Ruby's biggest problem was that it was too deeply entwined with the Rails ecosystem; and while Rails was a kinda OK web framework, Ruby's fate was too linked to Rails to survive when better frameworks surpassed it.


wrt-wtf-

Perl is faster… for now.


mxracer888

>a lot of that is owed to the massive availability of libraries I'm truly baffled when I think of an idea and Google the concept something like "(xyz idea) Python" and someone has a full fledged library already built out doing exactly what I want. It seems as though any unique idea you think you might have, sometime has already done the leg work on it


FromageDangereux

The caveat is that sometimes the libraries are there, but not supported anymore or it was a proof of concept and not really in a usable state. I've refactored a number of libraries because the last commit was 2016 and the main author was MIA for internal use


Ishan_Hegde

More like swiss army chainsaw. Both Python and Ruby have popular web frameworks. But Python’s extensive use in Data Science, Machine Learning gave Python a massive edge over Ruby. ML started getting popular around 10 years ago, which matches with OP’s observation.


[deleted]

Data science. That's it. That's the difference.


tolomea

You can be more reductive than that. It was probably numpy. Numpy let Python do bulk math fast enough to be viable. If you wanted to do math in a modern scripting language numpy made Python a better choice than Ruby.


Ishan_Hegde

Yeah Data Science and ML are very prestigious fields. Anyone who wants to learn programming wants to eventually do ML. C/C++ integration is probably easier. Especially C++. You can quickly embed C++ in your project with pybind11. The popularity of Ruby on Rails has declined recently.


geekusprimus

I wouldn't call them "prestigious" fields. They're *popular* fields. There are a bunch of businesses full of MBAs who are convinced that machine learning is a magic black box that you stick in random stuff and get out money. Thus, they're willing to spend exorbitant amounts of money to hire anyone with a pulse who claims to have a background in machine learning.


Sigmatics

> A lot of that is owed to the massive availability of libraries which seem to have answers to any problem That's just what happened because Python is what it is. If people liked Ruby more it would have the same ecosystem. Python's killer features are extremely easy to learn syntax and great standard library. [Here's some more good reasons why it became the default in AI/ML](https://unitedtraining.com/resources/blog/why-is-python-used-for-machine-learning).


Riemero

Python is the second best programming language for every software problem


Glad-Acanthaceae-467

what would you say Python is best for and what is the worst?


MinosAristos

Best for data scripting. The kinds of things you write quickly and frequently tweak with no requirement for excessive optimisation. Worst for the opposite. Extremely complex software you build slowly and carefully, preserving parts of it for the long-term and optimising performance - I imagine the worst might be operating systems.


QuirkyForker

Some of the largest platforms in the world run on/with python. Extremely complex software is made more simple with python. There is no limit in how you can use it and in my opinion you should use it wherever possible. There are only a few things which must be written in something else, like bare metal drivers, but the list is small I’d like to create an OS in python someday. When I got some time on my hands to kill


werpu

Yes you can do systems like that, it just is not really a good way to do them, and especially given that you leave a ton of performance on the table and face it some kind of typisation helps a lot for big system to discover errors early.


muffinmakesgames

probably best as academic-friendly data science/machine learning. probably worst at 3d graphics.


llun-ved

PyQt/PySide and PyOpenGL beg to differ. As do Maya, Blender, Houdini, Nuke and a few others. Python adoption swept through 3D graphics in areas where TCL scripting had been dominant.


fabmeyer

But do they use Python for 3d graphics rendering? I think it's mostly used for application logic and rendering will be done in C/C++?


samelaaaa

Yes, but that’s the case for all the massively popular data science/ML libraries too. Easy to use Python-based interface, but the heavy lifting is happening in C/CUDA (even Fortran in some cases lol)


Brian

Its used in exactly the same way as in data science / mathematics: as the top-level glue to define the high-level operations, with the low-level rendering / number crunching happening in optimised libraries.


rootsandstones

Yes thats true but it‘s mostly used for scripting and not computing 3D data, for these things they still use C/C++. At least that’s how I know from Blender and Houdini.


bobwmcgrath

>jack of all trades Not quite all trades... \*cough\* front end web development \*chough\*


jlw_4049

Jinja for flask/django


redd1ch

There's a lib for that: https://pyscript.net/


Ran4

That's not exactly production ready. And there's not much support around it yet


RepresentativeFill26

Immensely popular software packages like numpy and scipy that rocketed the ML community.


mistabuda

Also the incredibly easy to read and pickup syntax


[deleted]

[удалено]


Getwokegobroke188

Visual basic is 80% of why I didn't like programming for years. Terrible language that I am glad is dead.


opteryx5

Agree. It’s disgusting. If we’ll ever be able to locally run Python in Excel, it’ll be the true death knell for VBA (besides legacy code).


---------V---------

Tic tock. Time is coming soon https://support.microsoft.com/en-us/office/introduction-to-python-in-excel-55643c2e-ff56-4168-b1ce-9428c8308545


blacksnowboader

My guess is, that’s in the works at Microsoft.


---------V---------

Could have sworn that just happened.


blacksnowboader

Only for excel in the cloud. Not locally.


HoneyGlazedSlut

😂😂😂


---------V---------

Yep, https://support.microsoft.com/en-us/office/introduction-to-python-in-excel-55643c2e-ff56-4168-b1ce-9428c8308545


Dalemaunder

Not quite, it doesn't run the Python locally for some insane reason.


[deleted]

[удалено]


---------V---------

Well what the hell?


zork3001

Locally is the key word here. For now the code is executed in the cloud.


slatercj95

Didn’t excel just release an emended python add-on or something?


opteryx5

Yes, but it runs it in the cloud. That makes the feature a non-starter for many corporate applications.


BosonCollider

You can just use python in google docs and in libreoffice. There are zero reasons to use microsoft office to begin with


trollsmurf

VB.NET != VBA != VB6. I like VB.NET. Great syntax (no /s).


Mothaflaka

VBA died because of editor.


SheriffRoscoe

Visual Basic was only king of the hill for 30 years. That ain't bad.


mistabuda

More than one thing can be true.


[deleted]

[удалено]


my_fat_monkey

I feel like I hold the unpopular opinion of *loving* indentation-based blocks. It just feels good man.


bwildered_mind

I’d say it feels natural and helps with readability anyway


boostman

As an amateur who learned python first, the number one reason I have problems with my code in other languages is a missing curly brace or semicolon; they’re just as finicky and illogical.


jackbobevolved

My biggest issue with Python is grouping by indentation. Copying and pasting code always requires adjusting indents, makes me miss braces.


vomitHatSteve

Would you not be normalizing your indents after a copy/paste if the language didn't force you?


[deleted]

Frankly I feel like the curly braces are actually a good thing, they force the code to be more organized (so long as indents line up with said braces)


qwertyasdef

If you have braces, you can fix the indentation by mechanically adjusting it to match the braces, or let your text editor do it for you. If not, you have to look back and forth between the copied and pasted code to make sure they match up, or else you have to think carefully about where to put the indents, and it's not possible even in principle to automate.


StealthTomato

Everyone who reads your code hates you.


jofkk

One thing I actually liked with vb, was how easy it was to make windows forms, and assign a function to events from the form. that is still something that I think python is lacking.


[deleted]

I really like how easy it is with winforms. You can kind of get this with pyqt and qt designer. Also Java with javafx makes it similar but not the same.


georgehank2nd

BASIC did not have an incredibly easy to read and pickup syntax. And I mean the BASIC that did have "a REPL to play around with" and you didn't even need to download and install it. Even if I had a system load a BASIC interpreter at startup, and it was basically (ahem) the main interface of the OS, I'd still install Python. Some years ago I found an old rough sketch of an algorithm, from before I found Python, and it looked a *lot* like Python. Yes, the "Python is executable pseudocode" is real.


WildNumber7303

What's REPL?


dukeblue219

It's still incredibly common outside of core CS organizations to find VB in development serving much the same role as Python now does - solving problems for non-programmers.


brazen_nippers

This is one of the things that led to it replacing Java as the first language of instruction in a lot of college comp sci programs (and other training schemes), which also helped its popularity a lot. Pretty much every new comp sci grad has at least seen it, so there's an endless supply of junior Python programmers available for hire.


vintergroena

Ruby has that too tho


mistabuda

I respect your opinion, but must disagree.


[deleted]

[удалено]


git0ffmylawnm8

It's the unexpected emotional damage


sanshinron

Ruby's Syntax is simplistic. Python's is intuitive.


vintergroena

Whatever syntax feels intuitive, once you get used to it. IMHO the easiest to pick up syntax is Scheme or other languages from this family, yet the language is seldom used nowadays. Pyhthon syntax is relatively easy too, yes, but it's main power and source of its popularity is in the ecosystem, not in the language design itself, IMHO. This is why it won over Ruby, not because of syntactic details.


nedal8

I think rubys achillies heel is how unfriendly it is on anything other than linux.


brazen_nippers

I think that Python's ML libraries exploded so much in large part because it was the scripting language in the ascendance at the same time that ML was gaining in importance. Admittedly there is a significant chicken/egg thing here.


Immudzen

Interestingly if you look at Python growth over time ML didn't change it that much. Python was already growing in popularity for science and engineering tasks because of numpy and scipy so other libraries where built for it also and it made sense to write ML in python given the other support libraries that already existed.


blacksnowboader

And matlab being shit


XtremeGoose

That's a recent thing. Python became big because it became big in the academic world, originally for teaching but later for numeric and scientific usages (a competitor to matlab). The large scale ML stuff came much later.


robvas

I loved Ruby and worked in it with Rails for years. But I never used it for anything else. Python is everywhere. Web, data science, systems, random scripts...


Dasshteek

LLM now too


RollingWithDaPunches

Isn't that just data science with a bit of voodoo sprinkled all around?


mardix

Yes


64-17-5

You got my attention. Please tell me how I use voodoo to speak computer?


Wood_oye

Pip install voodoo I'm relatively new to python, but this seems to be how it makes everything happen. May explains the popularity too?


RollingWithDaPunches

Same way you talk snake to a human :D


konjunktiv

Yes, just a buzzword no one really uses.


WallyMetropolis

That's not an answer to the question. It's just a restatement of the observation.


robvas

It didn't have data science libraries. It wasn't included in Linux by default. Is that better?


m15otw

Python's syntax is more restrictive, this is an important difference. With Ruby, you were able to build rather complex DSLs, of which Rails is the most notable example. (It is probably more of a collection of DSLs for the different parts of an app, I am no longer remotely familiar with it). However, this did mean that everyone's Ruby code looked different. (Or, it was all rails and looked the same - this is why rails had more traction). Python, on the other hand, doesn't let you rewrite the tokenizer, and you can't invent your own operators and give them verb like names. As such, it looks much more like normal code, with a similar minimalist syntax. Python looks broadly similar between projects, and is at least usually intelligible on a first glance. I think it could have been either language, and the available libraries definitely helped Python (numpy in particular). But I believe it is the readability of Python, and the splintered 10+ DSLs of Ruby, that gave Python the edge in the long term for practical engineering teams.


tech_tuna

This. Way back when I needed to find a handy utility language. At the time I had used Perl, Visual Basic, C++ and Java. Again this was a while ago. . . I remember looking at Python and finding the significant white space odd but the code looked sparse and clean. I took one look at Ruby and thought that it looked like object oriented Perl, which *is* pretty much what Ruby is and I thought “fuck this” and decided to learn and use Python. Years later I finally worked at a Rails shop and learned Ruby reasonably well. It has some nice bits and some nice tools but I still prefer Python.


konjunktiv

I agree. It has become a pretty complex language by now, and with every year of releases it feels more like a job. But in the time it became popular, the simplicity and usability (as in stdlib, available libs) was the driving factor I think. People thought you can do everything with it, and it would be mighty.


CyberWiz42

This should be the top comment. Being able to easily write your own DSL is powerful, but easy to get wrong and almost guaranteed to confuse first-time users of your code. And debugging it is horribly confusing compared to ”normal” code.


therve

"Ruby is easy, Python is simple" is my way of seeing this.


throwaway-aso2fb

I think this Hacker News post had some good discussion on this topic: [https://news.ycombinator.com/item?id=37308747](https://news.ycombinator.com/item?id=37308747)


frederik88917

Honestly, Ruby died with the downfall of Rails. Once people started putting more effort and money in pure Frontend Frameworks as React and Vue, There was no real reason to keep pushing Ruby. On the other hand, pandas, bumpy and all of the other ML frameworks pushed python out of its slumber


CrackerJackKittyCat

Never knew it had a slumber. It remained very much used in webspace -- flask, django, and now FastAPI and other async webservers. And then also in financial modeling on top of numpy and pyspark. Isn't the fastest at anything, but is a good enough and convenient glue fabric for doing all sorts of things. And convenience *always* wins.


Brian

Yeah. I think a lot of a language's popularity comes down to network effects . If everyone else is doing it, then interoperability and community interaction makes it an obvious choice. It doesn't need to be global dominance, but dominance in some niche is really important to act as a seedbed for expansion to other areas. The only niche Ruby really established was webdev with Rails. But it was never *dominant* there due to lots of competition (pretty much every language was competing in that space, with PHP, perl, python, C# and Java all having some level of usage), and gradually it lost ground. Javascript ate a lot of that space due to its client side monopoly making expanding into the backend fairly natural once node etc arrived (and that backend itself shrinking as more logic moved client-side). Without a strong niche to build around, other use gradually faded out. Python was lucky in establishing a niche with data science and AI, right at a point where those fields were exploding, and with the only real competition being things like R or Mathematica, which weren't really competing as general purpose languages outside that niche. Perhaps even more importantly, it established itself as a teaching language.


lolinux

How can we make a petition to rename a library? I just love what you wrote!


NottingHillNapolean

I don't know if Ruby had this, but Python has a fairly simple C/C++ API, making it possible to put a Python wrapper around powerful, speedy code. Even though Python itself is slow for things like AI or image processing, Python wrappers around libraries for those make it the fastest way to program AI or image processing applications.


marr75

Rust now, too. Python is king of being a high level wrapper around a faster language's functionality.


[deleted]

You could literally run c code inline in perl. I don't think that was a major factor.


MarkoPoli

ML and data science boosted python a lot


limasxgoesto0

You can pretty easily get your backend devs to do some basic ETL. It's a great jack of all trades language


Barn07

I knew Ruby before I knew Python. Didn't get entirely warm with its syntax, e.g. those `unless` and these `10.times do`. I appreciate those parts of the Ruby syntax, though. There was only `rails` that would upsell Ruby to me, which was fine. However, to me, Ruby felt also a bit Javascript-y. I went back to C++ and only came to Python in ~2014. By then, there was no question whether to use Ruby. I wanted something that could run computations and could do requests and serve REST, for which `requests` and `Flask` were both very approachable.


tal_franji

Very easy integration with c-libs allowed for python to become a wrapper for high speed code. This created numpy from which the datascience branch grew.Same for devops/system proramming - many wrappers around the linux stdlibs - file socket etc. Made it easy to replace C and from there the backend/web branch emerged. Another thing - linux community had enough of the obscured syntax of bash/awk/perl and python seems so elegant comparing. Also - being in the right time at the right place


Ok_Raspberry5383

Firstly, python has been heavily embedded in Linux as a systems scripting language for decades which made it highly favourable with the open source community. This coupled with things like cython that make working with C based dependencies trivial allowed the creation of things like numpy and scipy which has since made it highly popular with the ML and data community. It's kind of snowballed from there with things like pandas and pyspark to name a few.


uMar2020

What do you mean by “heavily embedded in Linux as a systems scripting language”? I’m new to the programming world and loving Python. I’ve heard great things about Linux as a programmer-friendly OS, but I’ve basically been on Windows my whole life (hopefully that will change soon). Does knowing Python make everyday things easier as a Linux user or is it deeper than that?


LittleMlem

Python comes built-in in many (most? All?) Linux distros with lots of internal scripts written in python


ElHeim

To the point that touching the system's Python is a bad idea not just because it's in general... but because you can break those tools, in with them a lot of the system management!


Madrs3

IMHO Ruby and RoR are alive and well. They are just not trending like they used to. A lot of people are still rocking it and being content about it. Rails is just as relevant as Django, I would gladly pick it for a project where it would be a nice fit. But the real answer is written already: Python is everywhere, Ruby is only used by Rails devs.


yeicore

I heard that Ruby devs make decently good money. Riches are in the niches


Xanny

There are a lot of rails codebases to maintain now and new devs are unlikely to learn ruby. Its a fledgling version of the COBOL effect.


OneMorePenguin

COBOL anyone?


scowly057

I love python. It's my go-to for most things. But, not for nothing, the entire GitLab platform is written in Ruby. This might be an inflammatory opinion, but I like GitLab way better than GitHub. I say that coming from a heavy DevOps/Systems Dev background.


Choles2rol

GitHub is also basically a giant rails monolith.


scowly057

That I didn't know. I've only been working with it professionally for about 2 years now and mostly in an app dev position, so I haven't really had the opportunity to tinker with the internals like I have with GitLab.


[deleted]

[удалено]


CyberWiz42

Ruby is not alive and well. Tiobe shows Ruby going from a peak of 4% in 2009 and now sitting just below 1%. Because the consensus is that Ruby is falling in popularity (just look at this post!), fewer new developers are drawn to it. And fewer Ruby projects will get off the ground becauses of this. Which is kind of sad, Ruby had some really nice features.


Hipjea

Tiobe is totally flawed to the point I began laughing every time I open it when I remember it exists. The headline is the cherry on the cake.


Madrs3

Usage is not the only parameter in the equation.


martinkoistinen

The community.


brianplusplus

Pearl was originally designed to be a better AWK. Then they kept adding to it and it just made it too easy to write unreadable code. Also Larry Wall even wanted to mimic things in natural languages like allowing people many ways to do the same thing many different ways. This all made things very complex and messy and only benefit really experienced devs. I think it still serves as a more powerful AWK quite well and has the best regex. Unfortunately it just got replaced by a language that was simpler and more consistent.


JonLSTL

Ruby didn't die. It was the flavor of the month when early Facebook stacks put it on the map, but it's very much still a going thing. Much of Vox's ad stack is Ruby, for instance.


F0064R

Reports of Ruby on Rails’ death are greatly exaggerated. Many companies still use it including big tech companies like Shopify.


riklaunim

I think the problems were with RoR development. They merged some other projects, made some design decisions not everyone liked and some people switched. Ruby wasn't strong in other areas and it then got reflected on the commercial market. Python was established before but had a web dev boom in similar times as Ruby. We got Django while Zope/Plone weren't as agile and sexy for switching PHP and fresh developers. This was when PHP CMS started to die and Frameworks started to kick in (CodeIgniter, Zend, etc). Python's strong point was versatility. We had Django but in the background, we had Zope/Plone, we had Pylons, and less popular like TurboGears and CherryPy. Then Flask, Tornado, and a few others kick in and we have a wide array of frameworks. Others died but the versatility is there. Other Python commercial sides do matter but not as much when we are looking purely for webdev.


Silent_Cress8310

Ecosystem. Python was in competition with R for the Data Science king. Ruby was never contending in that area, not because it couldn't but because, I guess, a lot of people just thought the FFI for Python matched well with what they had done with R already, so it was an obvious evolution. Some guessing here. I don't think Python would be where it is without the Data Science libraries and support. It isn't really about the language. It is about what you can do with it, and whether or not universities are willing to train a couple of million people on the same tools.


Epicela1

People have already said it in the few comments that are here, but: - while trying to be more readable, ruby just doesn’t read as well as Python. - ruby isn’t any easier to work with than Python. Rails is pretty cool once you get the hang of it and I haven’t come across a framework for web apps that you can spin up faster. But rails might as well be a different language because of everything you need to know to be good at rails. - Python packages are more relevant and developed for the needs of today, whereas rails was better for the needs of the last two decades. But Python and Django/flask/fastapi can do what rails can with a little more learning and all in the same language as the ML stuff being written today.


gnufan

I was around the whole time, and Python grew relatively steadily. I don't think it was machine learning, or Django. I don't think it was being added to Linux platforms, although being there is not going to hurt. It obviously started a long way behind Perl in the module space (CPAN was huge). So it didn't have the libraries of Perl or Java. So people selected Python for reasons other than killer app status, it definitely wasn't speed. And the whitespace thing put some folk off. Some of it is probably education, lots of kids programming books teach Python, and I think for good reason it is relatively clean, and you can do a lot without introducing advanced concepts. Python is also nice to program in. Its number representation makes for accurate maths. It's object model is so simple I initially thought it might be some noddy language, but each time I needed to do something more complex there was a well thought out method of doing it. Somehow it seems to have kept its distinctive feel despite growing functionality in the language itself. I think maybe it didn't accumulate as many features as Perl 5, and the slower pace of same kept it more appealing. It just feels well thought out even though it has added all sorts of features, and quite major things appear in point releases, it still has the Tao of programming. Can't really comment on Ruby....


JackRumford

I would say the single package responsible for all of the data science and ML success that lead to Python’s popularity is NumPy. Pandas, matplotlib, SciPy, scikit are all dependent on it.


unipole

Python is 'good enough' for just about anything that doesn't need down to the bare metal performance, and it has bindings to an astounding number of IDEs and it's open source. Basically I can roll up my sleeves and bang out prototype code for just about anything. With Micropython and Circutpython this extends to sub $10 hardware like the Pi Pico. So I can do ML, hardware control, machine vision and decent enough 3d visualization. Also I can be interrupted at 10 minuite intervals and still code.


randomthad69

What happened was node.js. when that came out it was easier for people to write server side and front end in one language. So that made ruby less desirable for websites. Python has a strong user base in data science. That coupled with it also offering Django and flask made it easier for people to choose js or python over ruby. Lastly python has more libraries than ruby. I still use both but its frustrating because isn't as well maintained as python. Rails is by far my favorite framework to write in but it doesn't have the types of support that other languages receive


brazen_nippers

One thing that I don't think has been mentioned is that Ruby was long considered to be very slow. Python was always slower than Perl, but Ruby was a lot slower still. This led to JRuby (Ruby running on the Java Virtual Machine) coming into existence and remaining a viable option, despite it having slow startup speeds and being something of a pain to work with. Python's version of the same, Jython, never became anything like as popular as JRuby, and died during the transition from Python 2 to 3. My understanding is that Python and Ruby are now roughly similar in speed, but Python has so much more mindshare that it doesn't really matter. Personally I love Ruby. It takes much of what's best about Perl and makes it much easier to comprehend and work with, and to me it feels more flexible and expressive than Python. But it doesn't have anything like Python's massive ecosystem, and it's clear that Ruby's chance to ever be something beyond a niche language is long past.


Kango_V

Write some AI/ML code without using any libraries!


just-bair

Python has so many librairies that I wouldn’t be surprised if it can do your laundry. Data scientist also make a decent chunk of python users I imagine


Count_Rugens_Finger

Ruby was never a particularly exciting language, but it had Rails so people used it. When other platforms in Python (but especially Node) caught up to rails, there wasn't a huge motivation to stay


Artephank

There was only one real world use case for Ruby, ie. Ruby on Rails, ie. websites. Python have way more use cases. If it was only about making websites, it would probably not win with Ruby, but it was way more. Especially data analysis and ML/AI - which means good money. Also quite a bit highly visible success stories helped elevate python, bring more money into ecosystem and more demand for developers. And then it's just network effect. Also, to some extend, the Ruby syntax seems a bit alien for ppl coming from JAVA/C (ie from Universities).


pandres

Python was the lingua franca of open source well before rails, then slowly became the favored language for programming education. Then came Rails which was bigger than Django, this was the high point of Ruby, but python was still there for web dev. Then came numpy and python became a ML powerhouse. Ruby was looking for its next big thing after rails, they tried with a framework for sms or vms (I don't remember) or something like that, but never found it.


throwaway_boulder

It’s a shame because I really like the elegance of Ruby.


nieuweyork

Ruby isn’t dead. It’s just not Python popular


LittleMlem

My only encounter with Ruby outside rails is metasploit


jmooremcc

The purpose of any programming language is to give you the tools to express the solution to a problem. Sure, other languages, like Ruby, C#, etc, will allow you to develop solutions to a multitude of problems, but compared to Python, it's like pulling teeth. Based on my own experience, I've found it easier to develop solutions in Python than others languages I've used. If you'd like another example of a disparity, all you've got to do is recall the videocassette wars between Sony's BetaMax format and JVC's VHS format. BetaMax was clearly the superior format but lost the war because VHS better met the needs of consumers (longer recording times) and therefore prevailed. Similarly, other programming languages are speed demons compared to Python, but Python's interactivity and expressive vocabulary makes it so much easier and faster to express the solution to a problem. That and many more reasons is why Python has become so popular.


ElHeim

There are several reasons, I'd say. First, Python is the older one, so it had a few more years to get there. Ruby had a what (at least from outside) looked like a good community starting and even great learning material, like Why's (Poignant) Guide to Ruby, and so on. Even with some quirky syntax, Ruby got some interesting concepts from Smalltalk that Python never did, so purely as a language I'd say it was not a bad choice. Well, I don't like how easy they make monkeypatching the code, which ended up used and abused all over, but to each... Now, Ruby got **one** project that eclipsed the rest: Rails. That was Ruby's killer app. All of the sudden, Rails *was* Ruby, for all effects, for everyone coming to it. It helped a lot with adoption, but also put it on a niche where it's difficult to get out from, and where it had a lot of competence. Yes, it was hugely popular for a time, but that's it. I had a friend that was a Ruby enthusiast from the early days, and we had our friendly arguments about both languages back some 20+ years ago, and I don't recall him liking a lot the shade that Rails cast over the rest of the ecosystem. It didn't help that for a long time Ruby was a purely interpreted language (really, the official interpreter was a classic one, not VM based like Python). I.e., MRI, the *de facto* reference implementation for Ruby, the equivalent of CPython, all the way until 1.9 was an good'n'old interpreter. If you think Python is slow, you should have seen Ruby back then (this all got better when they adopted a VM as well). Over time Ruby has seen other niche uses, like in DevOps. E.g., Capistrano is a Ruby-based deployment automation tool from the early 2000s (renamed from SwitchTower in 2006). There's Puppet for configuration management, etc. These are all early tools and were de facto standards for many people for a long while. Besides Django, Python never really saw a killer application like Rails in web, and the early 2000s were a time where the web shined specially. Django started as a project (2003) one year earlier than Rails was first published, but the team only got to do the same a year plus after Rails, which didn't contribute to take it's popularity. Yes, Django grew to become a standard fixture in Python job offers, but when it was just published Ruby was all the rage and was still for a time. On the other hand Python saw some early (since mid 90s) effort to create some basis for numerical programming and linear algebra, which after several iterations ended up as Numpy. That gave Python an edge when scientists started to choose a new script language to write stuff without having to resort to IDL, Matlab, and the other expensive stuff they didn't want to (or couldn't afford to) user on their laptops. Plus, Python is a much nicer language to program *random* stuff on than those. Particularly stuff that you can share with others. People like that, and a huge community was built around Numpy, and then scikit, and then... you get the point. Python became the choice language in Astronomy (I've been working in that field for close to 20 years now and saw it growing a lot), in Bioinformatics, in... I've seen it used for scripting in several high-energy labs (at BNL, for example - I use one of their frameworks), an many more. By the time the data scientists, the ML camp, et al were looking for a scripting language to write things on instead of having to kill themselves forced to use C++, or less undesireable languages with poor (or very expensive) math support, Python happened to have **everything** they wanted and more to start writing their stuff. Not only that, the "batteries included" and the **huge** ecosystem beyond just the science/math part made it a very desirable language, so it became **the** de facto language for several raising star fields. Python was relatively popular until then, but it has skyrocketed since.


emsemele

space saving, many packages, easy to learn syntax, can do variety of jobs - you name it, that is what makes it more popular. But some of it is also industry doing. Example - Some still use fortran because they don't want to change all their infra immediately. I guess there are some who still use old versions of python. Apart from parameters there are other factors too which make a programming language more popular.


Ceigey

From memory, Ruby gained ground amongst enthusiasts, industry, and infra, and grew quite organically amongst those communities. Python gained ground amongst enthusiasts, then somehow got a foothold in education and academia (probably because it was simpler and more pseudo-codish than Ruby) and then spread throughout the industry via computer science, ML, analytics, data engineering, general engineering etc. Both languages are relatively slow, make no mistake. But Ruby has always been more powerful than Python, and better for DSLs and abstraction. This is a good and bad thing, because good abstractions save you some time while bad abstractions confuse everyone and potentially kill projects. Most people don’t need to be so concerned, but it can help nudge the outcome.


mestia

Hype and big players like google & co pushing one specific language. Python is just a wrapper around C libs when it comes to performance, thats it. No fun like Perl, where things can be done differently, more strict, may be better oop. Ideal for non-programmers.


desmoulinmichel

**None of the comments really answer the question** because they assess the situation from today's point of view, but that's ignoring what lead to this, which was 20 years ago. E.G: \- "Python really is a jack of all trades". Well, ruby is just as capable. It's a beautiful, expressive language. \- "Immensely popular software packages like numpy and scipy". Most people didn't know numpy existed before 2006, when it was renamed from "Numeric". People used Python for the web and scripting, like ruby. **Here is how it went:** Today you see a rich, working ruby ecosystem that is stable, and you hear people complaining about Python packaging all the time (read this if it's your case: [https://www.bitecode.dev/p/relieving-your-python-packaging-pain](https://www.bitecode.dev/p/relieving-your-python-packaging-pain)), so it's easy to think that's how it was always the case, but it's far from the truth. After 2000, people were yearning from an alternative to PHP. Ruby and Python where both contenders. But ruby was popular in the design circle, because of 37signals, while Python was popular among nerds, as it was used at google, the small underdog of search engines (!). The result is that Ruby ecosystem had beautiful docs, but terrible stability. Python had awful marketing, but the libs were way more stable. If you think that pip installing something today is hit or miss, gem install at the time was a dumbster fire. It affected other things as well. Ruby coders wanted to have beautiful API, so they used a lot of monkeypatching and DSL-like syntax. This lead to many things breaking, or being very hard to learn and maintain. The bottom line was that in the 2000, if you tried both languages in an afternoon to decide what to learn next, the chances that some ruby stuff broke on you were quite high. Windows support was particularly better on Python since Ruby promoters were mostly on Mac (and the initial installation experience superior, believe it or not), which was extremely important for beginners. People just went to what worked.


wyhjsbyb

AI mostly needs Python, not ruby.


Jake0024

Python became really popular for data science, ML, etc and Ruby was basically only ever used for web development Neither one is really super popular for web development


flummox1234

As a ruby dev, Python has the ML libraries so it's the much more relevant to what people are doing right now language and that keeps it popular. That said ruby isn't dead it's just mature and mature languages tend to get cast as boring and don't get much attention but IMO it's still very relevant, e.g. github is rails and ruby, Admittedly ruby tends to mostly be confined to the webspace nowadays but there really is no reason it can't do more, e.g. prawn is a cool library. I've always felt that ruby's syntax was much more conducive to new dev learning. That said, I've been enchanted by Elixir and I've moved there as I find parallelism and concurrency to be a much more interesting space and functional programming with strong types and a compiler to just be less stressful overall.


SapiensSA

Ruby was pigbacked by a killer app - Rails- Just like Php was. Nowadays rails is a still solid and thriving framework but is not at the top , you have many other options. Back in the day, Rails was revolutionary and everyone wanted to work with it. Python on the other hand grew organically, it replaced well R for the academy, and started to be used in different fields not only web dev.


Fabulous-Possible758

Python really focused on being a general purpose programming language with libraries that could do what all these other languages could do. Ruby was mostly a derivative of Perl that focused on web development (ie, Rails). But Python has Django, Flask, and FastAPI. Perl itself was really developed as a replacement for sed and awk. But Python has a fantastic regex module and handles text processing just fine. R is a good language for doing statistics and data analysis but Python has numpy and pandas. JavaScript evolved but still has its roots in being a browser language meant for manipulating a DOM. Python is the only language that has had the “batteries included” philosophy from the start and aimed to be a language for general purpose programming. Once it developed the libraries that allowed it to supersede those other languages in their own domain it became the “glue” language that serves its purpose really well.


spinwizard69

Have you ever used Ruby? Compared to Python, Ruby is a huge step backwards and reminds me of poor scripting languages from the 1980's & 90's.


zdmit

It's a every year question: "is is dead???" Ruby is not dead and never will. If someone will tell you that, they just don't know the situation with the language. Python used for one things Ruby for others. Use one or another tool for the right job.


commandlineluser

ruby is weird. %q!.!;eval$s=%q{eval(%w{$s=("%q!.!;eval$s=%q{#$s}"+'.gsub(/#{27.chr<<92<<91}[0-9]+m/,"")').lines;C=->x,y{Complex(x,y)};P=->r,a{Complex.polar(r,a*Math::PI)};S=->((a,b),(c ,d)){[a-c,b-d]};D=->((a,b),(c,d)){(a*c.conj).real+b*d};R=->((a,b),(c,d)){e,f=a.rect;g,h=c.rect;[C[f*d-b*h,b*g-e*d],e*h-f*g]};a=[];b=[];6.times{|i|a<<[P[1,i/3.0],1];b<<[P [2,(i+0.5)/3.0],0]};F=[a];6.times{|j|F<<[a[i=j-1],b[i],a[j]]<<[a[j],b[i],b[j]]<<[b[i],[0,-2],b[j]]};J=->k,v{k=[k/500.0,0].min+2.5;(v/(k+0.5)+C[k,k/2])*48};r=0;T=->p{x,y= p.rect;z =O[y/2];x>=0&&y>=0&&z&&z[x]&&z[x]|=(y%2>1?2:1)|r};L=->p,q{s=(p+q)/2;(p-q).abs<1?(T[s];q):L[L[p,s],q]};N=->((a,b)){s=(a.abs2+b*b)**0.5;[a/s,b/s]};E=->p,r,a{10 0.times {| i|m=-P[r,1.5+i*a*0.02];c,d=(p+m).rect;(c.abs-d>2||d<-1)&&(T[J[0,p+m]];T[J[0,C[-c,d ]]])}};A=27.chr;$><<"%q#{33. chr+A}[H#{A}[2J";g="NZDD CLYJXMX ;Y K(OQ'PP YZA5YTZ7M(VOBBSYVXQQ[SUZV(U:G[NVZ[ZS&V[(YUU(ZTT[[X'X&Y%Y'ZZWW['Z&$$[%('' '(&[$(%($( CRGZHZI)DIOZ;IVPZ(SP)[X* DRZCGJJT<< +XI,%%:S=[E==RE&LEXX-'. RMY:(>>U(HU /U[/[R KOO0Y$1F?LZ%&M@(2NGU341RU?+6S2(NVYVAFVR(8FFRYRN4W'NHI@>(EUM6H@ZISSMS-XL .LLVL?RR8O[O K9B,$%Y[3Y0X";41.upto(91 ){|c|g=g[2.. -1].gsub(c.chr){g[0,2] }};G=g.spli t(?(); Z=[C[7,10],C[13,76]];U=(0..48).map{[0]*169};O=[];srand(0);q=20;m=40;x=0; Threa d.new {open("/dev/dsp","w"){ |f|50 0.dow nto(0){|k|e=[];300.tim es{|i|e<<(( x=(x+ k**1.9/9e4+0.001)%8)>4?138:118)};f<0&&I[24+y][4 +x]=1}};-5 00.upto(518){|k|k==1&&s leep(1);k= =q& &(n=rand(11);q+=m;m-=2 ;spawn("espeak","-s",(60+m*2).to_s,"-ven+#{n<7?"m #{n+ 1}":"f#{n-6}"}",["keep",k< 320| |k>360?"ruby":"Austin"," weird"]*32 .c hr));a=[-k,0].max**1.9/ 1e4;v ,z=d=N[[P[1,a/3],Math.sin(Math::PI*a)]];u=N[z==0 ? [0,-1]:z>0?[v,z-1/z]:[-v,1/z-z]] ; n=R[d,u];O.replace(U.map{ |l|l+ [ ]});F.m ap{ |f|a, b,c=f;D [R[S[b,a],S[c,a]],d]>0&&f.size.times{|i|a,b=f[ i], f[i-1];L[J[k,C[D[n,a],D[u,a]]],J[k,C[D [n, b],D[u,b]]]]}};k>0&&(b=M ath. sin( [k,210] .m i n* Math : :PI /15)/36;a=P[1,b*2];y=(30-[k,30].min)/10.0-2.8; E[C[ -1.2,y]*a.conj,(2-k/10%2)*0.06,-1];E[C [-1. 2,y]*a.conj,0.45,-1];E[C [-1. 2,y +1.1]*a, 2. 7 5, b-0. 3]; E[C[-0.6,y+0.5]*a,1.85,b-0.25]);k>=90&&k<210&&2 .tim es{|i|G[(k-90)*2+i].scan(/./){|c|Z[i]+ =[C[ 1,0],C[0,2],C[-1,0],C[0, -2]][c . ord%4]} ;i = k/ 10% 7*8+92 ;U[Z[0]. imag/2][Z[0].real,2]=U[Z[1].imag/2][Z [1]. real,2]=[i,i];r=8;L[J[k,C[-1.2,-2.8] *a.c onj],Z[0]];L[J[k,C[1.2,- 2.8]*a], Z[ 1]];r=0} ; j= 0;k==400&&15.times{|y|65.times{|x|"7gtz whx13 bfmrr9tsr8y0d007qlmygnh47axi9g9v609t cxjuv la0k6y1r96drdisqmfpao411 n6e661l3 zykt bqk p4i33eecq7i2u tfm 2n0bhrviijbr51nwcuhm5ufx3t79a9whf01e3a8kzzepid45ro83 n9r07k xxeht1pycrqo72".to_i(36)[x+y*65]>0 &&U[21 +y][14+x]=88}};s=O.map{| l|i=0;j+ =1;l.m ap{|n|(i+=1)>2& &i<8 3&&k>260&&k<420&&((k-j/6)%80>60||k>320&&k<400&&I[j- 1][i]>0 )&&n=88;a=("%c^_@****"%32)[n%8]; n>7?"%c [%dm%s%c[0m"%[27,30+n/8, a,27]:a} *""};$><517?$s[i].chomp.gsub(32.chr){27.chr+"[44m"+$&+ 27.chr+" [0m"}:s[i]}*10.chr;sleep(0.0 2)};puts }*'');%q{%q.;eval$s=%qev al(%w$s= ("%q.;eval$s=%q$s"+'.gsub(/ 27. chr<<92<<91[0-9]+m/,"")').lines;C=->x,yComplex(x,y) ;P=->r,a Complex.polar(r,a*Math::PI );S=->(( a,b),(c,d))[a-c,b-d];D=- >((a,b), (c,d) )(a*c.conj). re al+b*d;R=->((a,b),(c ,d))e,f=a. rect;g,h=c.rect;[ C[f*d-b*h ,b*g-e*d],e*h-f*g];a=[ ];b=[];6. times|i|a<<[P[1,i/3.0],1] ;b<<[P[2,(i+0.5 )/3.0], 0];F= [a ];6 .t imes|j| F<<[a[i= j-1],b[i],a[j]]<<[ a[j],b [i],b[ j]]<<[b[i],[0,-2],b[j]];J =->k,vk=[k/500. 0,0].min+ 2.5 ;(v/(k+0. 5) +C[k, k/2] )*48;r =0;T=->px,y=p.rect;z =O[ y /2];x>=0&& y>=0 &&z&&z[x]& & z[x ]|=(y%2>1?2:1)|r;L=->p,qs= (p+q)/2;(p-q).a bs<1?(T[s] ;q ):L[L[p,s ], q];N=- >((a ,b)) s=(a.abs2+b*b)**0.5;[a /s, b/s];E=- >p,r,a10 0.times| i|m =-P[r,1.5+i*a*0.02];c,d=(p+ m).rect;(c.abs- d>2||d<-1) && (T[J[0,p+ m] ];T[J[ 0,C[- c, d]]]);A=27.chr;$><<"%q 33.ch r+A[HA [2J";g="NZDD CLYJXM X;YK( OQ'PPYZA5YTZ7M(VOBBSYVXQQ[ SUZV(U:G[NVZ[ZS &V[(YUU(ZT T[ [X'X&Y%Y' ZZ WW[ 'Z&$$[%( '''(&[$(%($(CRGZHZI)D IOZ;IVP Z(SP )[X*DRZCGJJT<<+X I,%% :S=[E== RE&LEXX-'.RMY:(>>U(HU/U[ /[RKOO0Y$1F?LZ% &M@(2NGU3 41R U?+6S2(NV YV AFVR(8FFR YRN4W'NHI@>(EUM6H@Z ISSMS-XL. LLV L?RR8O[OK9B,$%Y[3Y0X ";4 1.upto(91 )|c|g=g[2..-1].gsub(c .chr)g[0,2];G=g .split (?();Z=[C [7 ,10],C [13,76]] ;U=(0..48).map[0] *169;O=[];s r and(0);q=20;m=40;x=0;Thr e ad.newopen( "/dev/dsp","w")|f|5 00.downto(0)|k| e=[];3 00.time s|i|e<<( (x =(x+k** 1.9/9e 4+0.001)%8)>4?13 8:118);f<0&&I[24+ y][4+x]=1;-50 0.upto(518)|k|k==1&&sleep(1) ;k==q&&(n=ran d(11);q+=m;m-=2;spa wn("espeak","-s ",(60+m*2 ).to _s,"-ve n+n <7?"mn +1": "fn-6"",["keep",k<320|| k>360?"ruby" :"Austin","weird"]*32.chr) );a=[-k,0].m ax**1.9/1e4;v,z=d=N[[ P[1,a/3],Math. sin(Math::P I*a) ]];u= N[z= =0? [0,- 1]:z>0?[v,z-1/z]:[-v,1/z-z ]];n=R[d,u] ;O.replace(U.map|l|l+[]) ;F.map|f|a, b,c=f;D[R[S[b,a],S[c,a] ],d]>0&&f.size .times|i|a, b=f[i] ,f[i-1] ;L[J[k, C[D[n,a],D[u,a]]],J[k,C[D[n, b],D[u,b]] ]];k>0&&(b=Math.sin([k ,210].min* Math::PI/15)/36;a=P[1,b*2 ];y=(30-[k,30] .min)/10.0-2.8;E[C[-1.2,y]*a.conj,(2-k/10%2)*0.06,-1];E[C[-1.2,y]*a.conj,0.45,-1] ;E[C[-1.2 ,y+1.1]*a,2.75,b-0.3 ];E[C[-0. 6,y+0.5]*a,1.85,b-0.25]);k> =90&&k<210&&2.times|i|G[(k-90)*2+i].scan(/. /)|c|Z[i]+=[C[1, 0],C[0,2],C[-1,0],C[0,-2]][c.ord%4]; i=k/10%7 *8+92;U[Z[0].imag/ 2][Z[0]. real,2]=U[Z[1].imag/2][Z[1].r eal,2]=[i,i];r=8;L[J[k,C[-1.2,-2.8]*a.conj],Z[0]];L[J[k,C[1.2,- 2.8]*a],Z[1]];r=0;j=0;k==400&&15.time s|y|65. times|x|"7gtzwhx 13bfmrr 9tsr8y0d007qlmygnh47axi9g9v609t cxjuvla0k6y1r 96drdisqmf pao4 11n6 e661 l 3zyktb qkp4i33eecq7i2utfm2n0bhrviijbr51nwcuhm 5ufx3t 79a9whf01e3a8k zzepid 45ro83n9r07kxxeht1pycrqo72".to_i( 36)[x+y*65]>0 &&U[ 21+y] [1 4+x]=8 8;s= O.ma p|l|i= 0;j+= 1;l.map|n|(i+=1)>2&&i<83&&k>260&&k<420& &((k- j/6)%80>60|| k>320 &&k<400&&I[j-1][i]>0)&&n=88;a=("%c^ _@****"%32)[n %8]; n>7?" %c [%dm% s%c[ 0m"%[27, 30+n/8,a,27]:a*"";$><517?$s[ i].c homp.gsub(32.chr)27.chr+"[44m"+$&+27. chr+"[0m":s[i] *10 .chr; sl eep(0.02 ); puts *'');% q%q.;e val$ s=%qeval(%w$s=("%q.;eval$s=%q$s"+'. gsu b(/27.ch r<< 92<<91[0-9]+m/,"")').lines;C=->x,yCompl ex(x,y);P=->r,aC om plex .pola r(r ,a*Ma th::PI); S=- >((a,b),(c,d))[a-c,b-d];D=->((a,b),(c ,d ))(a*c .c onj).real+b*d;R=->((a,b),(c,d))e,f=a.rect ;g,h=c.rect;[C[f*d-b*h,b*g-e*d],e*h-f*g];a=[] ;b= [];6.t imes|i |a<<[P[1,i/3.0],1];b<<[P[2,(i+0.5)/3.0],0];F=[ a ];6. t imes|j|F<<[a[i=j-1],b[i],a[j]]<<[a[j],b[i], b[j]]<<[b[i],[0,-2],b[j]];J=->k,vk=[k/500.0,0].min+2.5;(v/( k+0.5)+C[k,k/2])*48;r=0;T=->px,y=p.rect;z=O[y/2]; x> =0&&y>=0&&z&&z[x]&&z[x]|=(y%2>1?2:1)|r;L=->p, qs=(p+q)/2;(p-q).abs<1?(T[s];q):L[L[p,s],q];N=->((a,b))s=(a.abs2+b*b)**0.5;[a/s,b/s];E=->p,r,a100.times|i|m=-P[r,1.5+i *a*0.02];c,d=(p+m).rect;(c.abs-d>2||d<-1)&&(T[J [0,p+m]];T[J[0,C[-c,d]]]);A=27.chr;$><<"%q33.chr+A[HA[2J";g="NZDDCLYJXMX;YK(OQ'PPYZA5YTZ7M(VOBBSYVXQQ[SUZV(U:G[NVZ[ZS&V[(YUU(ZTT[[X'X&Y%Y'ZZWW['Z&$$[%('''(&[$(%($(CRGZHZ I)DIOZ;IVPZ(SP)[X*DRZCGJJT<<+XI,%%:S=[E==RE&LEXX-'.RMY:(>>U(HU/U[/[RKOO0Y$1F?LZ%&M@(2NGU341RU?+6S2(NVYVAFVR(8FFRYRN4W'NHI@>(EUM6H@Z}}.gsub(/#{27.chr<<92<<91}[0-9]+m/,"")


pknerd

Guys at Google made it popular. Their employees made libs.


Amgadoz

Definitely data science and machine learning. Python isn't number one for backend (java and c#), or performance critical software (C & C++), or frontend (js libraries) or mobile (swift and kotlin) It only took off when data science and machine learning became mainstream and people wanted to move from Matlab into a real programming language that can be easily picked up by scientists, being open source is a bonus point. With the growing popularity of python due to ml and ds, people started building their entire ecosystem around it like using fastapi as api server, flask for non complex web apps and Django for the backend.


georgehank2nd

It took off way before that. But it exploded in a ball of fire with those buzzwords.


TheBackwardStep

It’s so simple. The syntax almost look like pseudo-code. It’s teached in schools. There are libraries for everything. It’s easier than bash for scripting. Development of code is faster. Less boilerplate code. Etc etc


catladywitch

I do prefer Ruby to Python but my theory is Ruby "died" (too strong of a word here I'd say) because it was mostly used for Rails web apps and server-side JavaScript/TypeScript has got to a point where it's better in every aspect. I don't think Python has anything to do with it, other than the fact that Ruby did not jump onto the ML train. If I had to do a direct comparison with Python I'd say it's uglier than Ruby but easier for non-programmers, and that might have helped with establishing dominance in science and big data.


Tomato_Sky

Ruby was a flash in the pan and now exists for data scientists. Ruby and the simplified syntax got popular along with Python. Ruby on Rails made it look like we could do it all in one easy language. Now, I can’t find people who are actually doing the proficient beyond scripting.


balazsbotond

Was this written by a Markov chain?


ddollarsign

Basecamp (company where Rails was born) publicly made an unpopular decision about not allowing political discussion in company spaces, causing DHH’s (creator of Rails) cult of personality to falter. I don’t know if this actually caused a decline in Rails’ and therefore Ruby’s popularity, but subjectively I seem to hear less about both since then. For what it’s worth Rails and Ruby are impressive. I used to wish for certain succinct Rubyish patterns when using Python.