37 ms·
Ask HN: 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).
- bbstats 3y agobecause it's incredibly easy to use, and numpy and pandas are written in python.
- BerislavLopac 3y agoI like to say that Python is the keyboard of programming languages. These days, we have so many different ways to input data and commands into a computer: multi-touchscreens, digital pens, even voice recognition -- however, the huble old keyboard still rules, even on thouchscreens. The reason for that is that you will be able to use a keyboard even if you have never encountered it before; you will be slow and make many errors, but as long as you know your letter you will be able to input text. At the same time, someone with extensive training and/on experience in using a keyboard can be incredibly efficient, inputting hundreds of characters per minute with minimal mistakes. Python is in many ways like that: it's much easier to get you started with programming, not requiring cremembering complex symbols or syntax. At the same time, and experienced Python programmer will be able to write extremely complex software quickly, even if sometimes it will be somewhat slower than the equivalent in another language. And if you're _really_ experienced, you could even build performance-critical parts of your program in another, faster language while still maintaining the Python-based higher level.
- SurgeArrest 3y ago"Why Python" by Eric Raymond in Linux Journal is what started my love of python for me before Ruby or JavaScript outside of the browser were even a thing. https://www.linuxjournal.com/article/3882 https://www.linuxjournal.com/article/3882 A python script easily outperformed a bash shell script + shell commands for processing text and automating tasks. Most Linux system administration with Python is just so much easier than any other way, that was after I tried doing the same with Perl which was awful in terms of readbility just a few days after the script was written.
- nektro 3y agobecause of data analytics, which is a shame because both data analytics and python are rubbish
- coldtea 3y agoBecause 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.
- mydriasis 3y agoIt writes like English and you don't have to think about memory. Those two things are _huge_.
- huevosabio 3y agoPython 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.
- smashed 3y agoI agree. I've seen Python being taught in Physics and hard science university cursus as an introduction to programming 15+ years ago.
- pjmlp 3y agoWhen I was at CERN in 2003 - 2004, it was when the first set of Python introductory courses started. The build infrastructure for ATLAS used the CMT tooling, written in Python. The Summer School of Computing 2004 had several sessions related to Python in the context of grid computing.
- Qem 3y agoAccording 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 https://youtu.be/4RSht_aV7AU?si=d3rJvYJPFGcRy6BK Then it just snowballed since that time.
- Ekaros 3y agoBecause Python is not horrible general purpose language. In the end not everything is web.
- beardyw 3y agoNo 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.
- yCombLinks 3y agoPython is clearly the current winner. Not sure being pedantic about what it means to be a winner adds anything
- izacus 3y agoIf there's a winner, it's still named "Java".
- reducesuffering 3y agoBased on what? https://madnight.github.io/githut/#/pull_requests/2023/2 https://madnight.github.io/githut/#/pull_requests/2023/2 https://insights.stackoverflow.com/trends?tags=python%2Cjava https://insights.stackoverflow.com/trends?tags=python%2Cjava
- izacus 3y agoBased on the amount of software written in it.
- yCombLinks 3y agoI was talking in the context of the Ruby/ Python/ interpreted language world of the parent post
- gremlinsinc 3y agoif you're going off interpreted languages then PHP won. it's not as sexy or hot but it powers more websites than anytime else, or JavaScript which is also an interpreted language that is literally in every app so you could say it wins though I'd only count full stack js apps not PHP apps with a Vue frontend.
- znt 3y agoI think it just survived naturally, filling in the cracks left by Java / C++. And now the era of Textual (https://textual.textualize.io/ https://textual.textualize.io/) is here, python may get the spotlight even more.
- vopi 3y agoCan you elaborate why we're living in the era of Textual? Genuinely. It seems like a pretty nifty library but I'm not sure it transcends to killer library territory. Thanks!
- Someone 3y ago> 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)#Early_releases 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_history 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.
- arp242 3y ago> Ruby also was more or less a Japanese-only thing until around 2000 And after that it still took quite a few years until "English support" really became first-class and comparable to Python. I looked at Ruby around 2002-2003 or so (I was looking at many different languages back then, pretty much anything I could get my hands on), and lots of Ruby stuff was in Japanese or poor English. That's all fine, but I specifically remember that was the major reason I ended up not using Ruby at the time. (I did end up programming a lot of Ruby many years later, and for what it's worth I do prefer Ruby for most things now)
- philwelch 3y ago> 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.
- toyg 3y agoThe recent DevOps tooling is also not conducive to using code at all - it's YAML all the way down. Nobody is writing Go for everyday DevOps now, whereas for a bit they were writing Ruby and Python.
- singhrac 3y agoTo 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.
- monroewalker 3y agoI 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.?
- arp242 3y agoThis is probably a decent enough intro to get a general "feel": https://learnxinyminutes.com/docs/ruby/ https://learnxinyminutes.com/docs/ruby/
- tracker1 3y agoI 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.
- ActorNightly 3y agoLanguages 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.
- AlotOfReading 3y agoPeople have been making similar predictions longer than either of us has been alive. Remember Cobol? Basically that. 5th generation languages? Same thing, with a different definition of "describe". Ultimately, those all turned out to be dead ends while the "antiquated" languages kept improving and innovating, albeit usually by (re-)inventing things that already existed elsewhere.
- ActorNightly 3y agoYou are mistaking syntax for features. C++ got popular because it managed data structures under the hood automatically. I.e, you didn't have to keep track of memory offsets or function pointers. Java got popular because it did that and also managed memory allocation under the hood automatically. Python (and Javascript) got popular because it did all of that and also managed types under the hood automatically. The future is exactly this. Some language (or Python 5 or 6) is going to do all that except manage common processing algorithms for you automatically. For example, you will not need to import a library to convert xml to json, the .toJson call will be put through an AI inference algorithm that will essentially generate the required code for you on the fly, and more then that, it will do it in a much optimal way because it will recognize that the xml data follows a particular structure so it can optimize the search of the tags rather than doing a generic approach.
- AlotOfReading 3y agoThe discussion isn't about C vs Python, it's about why Python won over Ruby, a language at a similar level of abstraction. Ruby is arguably even less burdensome because in many cases the libraries/frameworks do a lot of magic that would be unpythonic.
- runjake 3y agoComing 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.
- hiepph 3y agoI also had a hard time choosing between Python and Ruby for my goto scripting language. But given Python community is more active outside of webdev, I also chose to stick to be more professional on Python.
- bjourne 3y agoIt 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.
- PartiallyTyped 3y ago> PEP 355 Didn't this eventually become what is now pathlib (which I am a big fan of) ?
- VerminOctopus1 3y agopathlib is truly excellent! The overlap with the os library is unfortunate, but I can’t complain.
- vodou 3y ago> except for rejecting PEP 355 which was a big mistake Looks like you are the author of PEP 355. Well, we got pathlib in the end. It's not that bad.
- stevesimmons 3y ago> Python also came in an msi installer and made the Windows experience pleasant For a long time, the official Windows Python distribution was overshadowed by ActiveState's, called ActivePython. That included more Windows-specific packages such as win32com, and the very capable PythonWin IDE from Mark Hammond. That was my go-to Python around 2000-2005. ActiveState was also notable in the early 2000s for hosting the Python Cookbook, the main repository of useful Python snippets and scripts. This was long before PyPI, StackOverflow and Github.
- physicsguy 3y ago
- ifyoubuildit 3y agoMy 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" on a random system are probably not great. Anybody else have this experience?
- jquast 3y agoYes, but I also had that very same experience with Perl, Ruby, Tcl, and Java during their peak heights of popularity, that they were pervasive and problematic. I feel the landscape of operating systems architectures were much more diverse, and the frequency of software releases and permutations of version combinations in the layers is larger than ever before.
- james-revisoai 3y agoRuby 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.
- version_five 3y agoI'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.
- reducesuffering 3y agoPython 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.
- rcarmo 3y agoLua is actually a much better embeddable language, but it's not as popular and has its quirks.
- Scarblac 3y agoPython 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.
- paulddraper 3y agoRails is far, far more popular than Django. However, the significance of both declined with the expansion of high-tech options (Spring, Go, Scala, Node.js) and the expansion of low-tech options (Firebase). So today the popularity of the backend frameworks of each language are less important.
- capableweb 3y ago> Rails is far, far more popular than Django. Maybe it used to, but seems a lot more people at least searches for Django pretty much everywhere except US, Canda and Japan. https://trends.google.com/trends/explore?date=all&q=%2Fm%2F0505cl,%2Fm%2F06y_qx&hl=en https://trends.google.com/trends/explore?date=all&q=%2Fm%2F0...
- paulddraper 3y agoFair enough, my information is outdated. StackOverflow agrees. [1] [1] https://insights.stackoverflow.com/trends?tags=django%2Cruby-on-rails https://insights.stackoverflow.com/trends?tags=django%2Cruby...
- byroot 3y agoIf you properly scope to the Computer & Electronics category to avoid matching "Django Unchained" the graph is quite different: https://trends.google.com/trends/explore?cat=5&date=all&q=%2Fm%2F0505cl,%2Fm%2F06y_qx&hl=en https://trends.google.com/trends/explore?cat=5&date=all&q=%2...
- aidenn0 3y agoI 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 https://en.wikipedia.org/wiki/Eggdrop
- peatmoss 3y agoI think it upset the Perl hegemony in part because of the enterprise infatuation with object orientation. Perl got a lot of flak from the Java/XML crowd (“Perl’s not a real language—it’s not object oriented!”). You could kind of write Java in Python, and thus a certain kind of enterprise techie couldn’t dismiss Python as “just” a scripting language.
- rcarmo 3y agoI (rather to the displeasure of many people) refer to that kind of OOP Python as "Java fanfic"...
- Stranger43 3y agoAnd of cause the fact that the Perl community relished in inventing new and exiting shorthand tricks that allowed perl script to be essentially write only unless you stuck to an style-guide that had not been codified. Perl like VisualBasic had a well deserved reputation for facilitating atrocious hard to debug code, and it was this reputation more then the lack of OO/XML support that led both of those to fade back into the realm of forgotten memory and business critical enterprise applications that nobody dares to touch.
- stcroixx 3y agoPython lets people who would not otherwise program write programs. Back in the day the same people used excel with macros.
- scionthefly 3y agoSo, it's both an effective entry point for beginners, and powerful enough to be a utility language for experienced programmers.
- aaron695 3y agoThe 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.
- mixmastamyk 3y agoYes, an aspect I never thought of ‘till now is that Python is/was cool but never trying particularly hard to look it. Understated British humor may have something to do with that.
- vb-8448 3y agoIn 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 3y agoRuby 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.
- mixmastamyk 3y agoWeird/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.
- carapace 3y agoJS is a ridiculous language. Ruby is another ridiculous language. Python has some very frosty deep roots in PL theory and practice, and it's a billion times better than C and a trillion times better than C++. (Java was and still is uncool.) Python became popular because it was so much easier and more fun than the other languages and it's (very serious) problems weren't as obvious back when the BDFL was running things, or until your project gets large. (We should all just use Lisp, ffs.)
- dekhn 3y agoBecause 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 3y agoPython 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 3y agoIn 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 3y agoReadability. 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.
- alpaca128 3y agoI agree the language is very readable overall but I find the whitespace based syntax less readable and practical compared to just using curly braces. Editors can color matching pairs, let me jump between start and end of a scope, select all lines between two braces etc and all that just doesn't work in Python. Also I find it more difficult to see where a scope ends. It has upsides too and is not a huge deal but I often wonder why people prefer this so much. Imho the reason for Python's success is mainly how easy and quick it is to learn, and how little time it takes to get something running. That alone removes so much frustration and perceived effort.
- mixmastamyk 3y agoTry turning on indentation guides in your editor, they help to visualize scope. If you are moving around large blocks often, well maybe they are too big? There are linters that can help with that kind of thing.
- Stranger43 3y agoPython 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.
- tobinfricke 3y agoWhen 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.
- worik 3y ago> When I first encountered Python, it was as an alternative to Perl. Me too I am amazed that Python won out against Perl Perl is much easier to use. Does not have the incredibly irritating treatment of whitespace Perl was a disrupter, whereas Python was "computer sciencey". A false dichotomy but it really mattered to people
- JAlexoid 3y agoPerl being easier to use is a joke... Ruby suffers the same issue as Perl does - you can do the same thing a million different ways, that's too many.
- zzzeek 3y agoa million different ways, but all with liberal use of human-unfriendly symbols like dollar signs, at signs, pound signs, etc.
- NegativeK 3y agoI loved Perl. I _loved_ it. It was so much fun. It felt like vim in how you could guess weird corners of the language. But every reason that made it fun is also an actual reason why it's a nightmare unless you are very strict in how its used. Strict on things like whitespace.
- tetha 3y agoI was about to say, as much as I enjoy python. Perl is more effective than Python. You can do some pretty amazing things in Perl in a few lines. You can also do amazingly readable scripts in Perl. But... if you aren't careful how you write perl, it's a very bad pit to fall down to. Python just forces you to write code that's better for the team.
- johnea 3y agoWhat exactly did it win? The prize for greatest number of incompatible versions?
- jeremycarter 3y agoIt won being the slowest, and most environmentally unfriendly language.
- rcarmo 3y agoI'll bite. 3.x was not that incompatible - I had zero trouble moving to it, because I had handpicked my dependencies throughout the years and the minimal syntax tweaks were exceptionally easy to flag and convert.
- r_thambapillai 3y agoPython 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.
- usgroup 3y agoPython doesn’t compare to R for analytical work — it doesn’t have the eco-system and R is specialised for it. Where Python broke in was machine learning which is not analytical work and often involves lots of general purpose programming. sklearn, skimage, opencv, Tensorflow, Torch, JAX, and so on are often used in a general code base. Torch was actually a C++/Lua framework initially before switching to C++/Python. Python has a dominant general purpose eco-system. It’s also a simple language to learn compared to R/Matlab/etc which are just horrible to use for data structures or paradigms other than vector/matrix based pipelines.
- paulddraper 3y ago> In that space, it had no competitors. Well, there's R. But basically, yes that's the long and short of it.
- jacurtis 3y agoOr 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.
- 3y ago
- latenightcoding 3y agoGood 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 3y agoRuby is really, really slow. Granted most interpreted languages are, but ruby startup time last I checked was at least 30% more than python.
- jmugan 3y agoI 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').
- jacobgorm 3y agoSame reason Pascal lost to C. Life is too short for BEGIN and END.
- JAlexoid 3y agoNot really. C(not C++) is better organized to understand how it will run on the CPU and how memory is allocated. Software engineers are engineers primarily, so we care about where our thing is going to run. Remember that Pascal was supposed to be 100% portable across platforms?
- throwawa14223 3y agoI 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.
- fictkgyicf 3y agohttps://arstechnica.com/science/2015/12/certain-customers-spell-doom-for-new-products/ https://arstechnica.com/science/2015/12/certain-customers-sp...
- throwawa14223 3y agoIt is off topic to the python/ruby discussion, but I wonder if there is a way to discover if I am one of these people.
- fictkgyicf 3y agoIt seems simple enough: a) a tendency to buy oddball products b) track record of finding that products you use are discontinued That is all there is to it. There is no psychometric test or theory.
- alpaca128 3y ago> If products you like keep getting discontinued, get used to it. Well that's me. I used Windows Phone 8, my favorite phone of all time was the Blackberry Passport and my first iPhone is likely the last iPhone Mini ever. At least the Steam Deck seems to go against that trend...I hope.
- morvita 3y agoI've heard so many people say that Ruby is really easy to pick up and work with and for some reason I've had the exact opposite experience. I have tried to learn Ruby at least three or four times and I bounce off it every time. There are a bunch of other languages that I've learned and worked with effectively, but for some reason my brain just refuses to grok Ruby.
- zdw 3y agoThere'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.
- agumonkey 3y agoyeah it's a good enough especially to start poking around many accounts of people dropping other languages with better perf or semantics to use python as a prototyping++ tool it was a trend in many dynlangs (php and others) where you'd write the core in it and drop to C for hot loops python is better than php, it has some metaprogramming (hello CLOS) to mold it syntactically wise, good enough stdlib, low enough semantic warts .. than and numpy/pandas for non sweng crowds
- earthboundkid 3y agoI think that's part of the answer. Python has multiple independent communities of use: web, data science, ML, devops. Most languages only have one or two ecosystems of use. I think the other part of Python's success compared to JS is a better story about C integration. Python itself is just a series of macros to make C nicer to use, which meant the existing C/C++ ecosystem was relatively easy to integrate. And then the sci-py world also brought in Fortran. JS is huge on the backend web, but it hasn't spread into other ecosystems nearly as much because the C integration story isn't as good.
- screye 3y ago> Python is not the best language for any particular task Python basically solved this problem by wrapping around C code that's far more performant, but still exceptionally simple to leverage due to python's simple syntax. LlamaCpp has C++ in its name, yet its most popular platform is python. So for certain applications, python because the undisputed #1. Because it was C in disguise, with better usability. With parallelization, Python having 100x slower loops became an old problem. 2023's coding paradigm is "if you're using loops, you're doing it wrong." People love complaining about pandas, but Dask solved all the single-core problems in 2021. > https://twitter.com/iammemeloper/status/1692901551558320254 https://twitter.com/iammemeloper/status/1692901551558320254 Amen
- moonchrome 3y agoRuby 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.
- cutler 3y agoYou're forgetting the period of Ruby's popularity in the devops world, especially Chef and Puppet.
- local_person 3y ago[dead]
- rcarmo 3y agoPuppet was pretty awesome. We used it to maintain and provision nearly every kind of software across a few thousand machines, even though it had a worrying tendency to remove user accounts (we once got locked out of the master...)
- moonchrome 3y agoI think that's just building on RoR hype in that same field. Puppet even moved away from Ruby AFAIK.
- cutler 3y agoI beg to differ. Most sysadmins I knew who used Ruby extensively had never touched Rails. There's no real connection between the two phenomena other than the language.
- avip 3y agopython does many things well ruby does one thing very well So apparently the "do one thing well" thingy doesn't always hold
- JAlexoid 3y agoThat one thing, RoR, isn't the best option at all today. The moment that XHttpRequest came to be - it started the countdown to RoR's popularity decline. HTML5 just made it permanent.
- zem 3y agoruby does a lot of things well - it is still the best language i've found for quickly exploring a problem in code, or prototyping a solution. i'm less happy with the experience of maintaining a large codebase in it but only because i've found other languages that have much better support for that.
- AdamH12113 3y agoThe 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 https://www.linuxjournal.com/article/3882
- sgt 3y agoGood memories. I still have that issue in the attic somewhere.
- dale_glass 3y agoI 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 3y agoPerl 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 3y ago
- ilikenwf 3y agoI really wish schools would teach compiled languages before scripting languages.
- bdcravens 3y agoWhat's the current CS101 standard? I know when I was in college in the late 1990s, it went from Pascal to C++ to Java.
- ilikenwf 3y agoIn college, sure - they actually started us on C/C++ and then had us work in ASM for discrete math... But in middle and high school now I believe they teach...whatever the teacher wants. So a lot of js, python, vb...
- deleted 3y ago[deleted]
- masklinn 3y agoGreat news, python is compiled, you got your wish.
- ilikenwf 3y agoUnless you use pyc it's only as compiled if you count php as compiled. Just in time bytecode compilation does not a compiled language make.
- masklinn 3y agoMaybe you should have been more precise when you made your wish to the monkey paw. Because python is certainly a valid answer to the comment you wrote. Also I think you’re completely wrong but that’s neither here nor there.
- jl6 3y agoI’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.
- dottjt 3y agoAs 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.
- rich_sasha 3y agoI 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.
- analog31 3y agoI think community played a huge role... the language basically want viral in terms of people sharing code, libraries, tutorials, and commentary. Timing may have helped too. My impression is that I started hearing about Python around the same time that the devs at my workplace were just waking up to open source, and Python was something that I could try out at home without anybody's permission.
- deleted 3y ago[deleted]
- andrewprock 3y agoThis 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.
- chombier 3y agoI 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.
- p1mrx 3y agoPython's old as dirt; it even predates Linux: https://en.wikipedia.org/wiki/History_of_Python https://en.wikipedia.org/wiki/History_of_Python Sometimes the key to success is to just be adequate for a really long time.
- mmphosis 3y agoPython 0.9.0 February 1991 https://raw.githubusercontent.com/python/cpython/master/Misc/HISTORY https://raw.githubusercontent.com/python/cpython/master/Misc... Linux 0.01 Sept 17, 1991 https://lkml.iu.edu/hypermail/linux/kernel/2109.2/03485.html https://lkml.iu.edu/hypermail/linux/kernel/2109.2/03485.html
- EdwardDiego 3y ago> just be adequate for a really long time. Seems to be working for Pepsi, and their killer model of "they don't have Coke, is Pepsi okay?"
- coreyp_1 3y agoWhat, no Dr. Pepper? I'll just drink water, then.
- WalterSear 3y agoI'll have the Khao Khalash, thanks.
- tomjakubowski 3y agoI'll take a crab juice!
- deepsun 3y agoWell, Delphi is still adequate, but others got more popular.
- chinchilla2020 3y ago> Sometimes the key to success is to just be adequate for a really long time. If that was true I'd be successful by now
- EamonnMR 3y agoRails 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.
- atoav 3y agoAs some who teaches Python I think one of the features that make python popular is that it can be very close to written language. That means if used right, it can feel very natural.
- svilen_dobrev 3y agolong 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.
- cutler 3y agoWhilst 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.
- VerminOctopus1 3y agoWhat about the design of Ruby makes it far superior?
- cutler 3y agoBlocks, Procs and lambdas compared with Python's crippled equivalent. Elegant built-in regex handling curated from Perl. Concise, expressive one-liners. Perlish list shorthand: %w(aa bb cc) => ['aa', 'bb', 'cc']. Everything an expression.
- daft_pink 3y agoMy 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.
- 3np 3y agoOne thing I think contributed that I've never seen mentioned: It's a lot easier to write unreadable Ruby than unreadable Python, especially if you consider novice readers. This affects maintenance and contributions to gems/pypi.
- mkl95 3y agoPython 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.
- bandrami 3y agoThe 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.
- taylodl 3y agoPython 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.
- krackers 3y ago>Java JIT compilation optimizations that's been applied to Python interpreted code I thought CPython doesn't JIT at all? What optimizations are you referring to
- taylodl 3y agoPyPy and IronPython
- colinsane 3y agoi don’t know enough about Ruby, but if it’s true that Python had better C interop early on then roll the clock forward and that should explain an underappreciated amount of the difference. why are so many Gtk apps written in Python? because `from gi.repository import <my_c_library>` gets you bindings to any gobject C library without extra work for the library authors or the library users. if that sort of thing’s existed for a long time, then yeah: Python’s gonna end up more integrated with the C-heavy computing environment of the era than any language that doesn’t bind so easily.
- allanwind 3y agoProjects 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.
- vmchale 3y agoPython 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).
- cutler 3y agoRuby 3.2.2 is slightly faster than Python 3.11 in quite a few benchmarks. I don't know what data you used to conclude that Python is faster than Ruby unless you're comparing something like Numpy and a Ruby lib which isn't exactly Apples to Apples.
- Mawr 3y agoThe original question is "why python won". That in 2023 Ruby is 1% faster than Python is irrelevant. Historically, Python has always been faster than Ruby. That certainly didn't help Ruby gain ground over Python.
- lnalx 3y ago> Ruby's poor performance hobbles it even in places it's supposed to be good (twitter was rewritten to Scala over rails). All performances are relative. Ruby or Python is very performant for 99% of websites, generally the bottleneck is the database. Rails has enabled Twitter to develop and iterate faster. But now that the social network has to manage several tens of millions of users, the 200 req/s of Rails are no longer sufficient. And Ruby in 2013 didn't have the same performance as in 2023. Hardware no longer had the same performance, too. (https://blog.twitter.com/engineering/en_us/a/2013/new-tweets-per-second-record-and-how https://blog.twitter.com/engineering/en_us/a/2013/new-tweets...)
- umutisik 3y agoI 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.
- amelius 3y agoThe ecosystem and critical mass.
- Dowwie 3y agoResponsive languages with tight feedback loops are best for 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 3y agoPeople 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.
- laurencerowe 3y agoI 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.
- rcarmo 3y agoWay 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 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.
- ketralnis 3y agoThere'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.
- 0x6461188A 3y agoThere is no win. This is an infinite game.
- dannyobrien 3y agoThis 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.
- treprinum 3y agoAcademics started pushing it and it replaced MatLab for many of their tasks. Then ML started exploding and that was already all in Python.
- mcemilg 3y agoI think it's just by a chance, Ruby could win too if the data people first gather around it.
- deleted 3y ago[deleted]
- natch 3y agoThis is just a feeling, but for me I was tired of the quirkiness of Perl, and Ruby offered yet more quirkiness. Python offered an opinionated and more crisp proposition, stating explicitly the goal among other things of having (paraphrasing the quote, so it might not be byte for byte) “one clear preferred way to do it” as opposed to the wild west that came before. And it had Google’s endorsement (Google was still respected at the time). JavaScript… wow. I think it’s gotten better now with more tooling and a rich ecosystem, so more power to it.
- at_a_remove 3y agoI will throw in an additional factor which has yet to be mentioned: ArcGIS chose Python. It isn't a huge advantage but is creates a persistent push over time.
- drbig 3y agoSo 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.
- Buttons840 3y agoWhat 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 and frustrations await. Python is much more boring in this respect, users are more likely to form accurate intuitions. What follows is my subjective experience as I came to like Python but hate 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 with fresh eyes, 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. I didn't seek out learning materials for the languages, I only saw how people were talking about them in the Asterisk community. I'm sure the right material would have explained what a "gem" was very well, but those obscure mailing lists I was reading did not. I never did give Ruby a fair shake, so don't take this as advice, these were merely my experiences as a new programmer looking at both languages with fresh eyes.
- mellavora 3y ago>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". print f"are you {sure} you need parenthesis to call a function in python" >Python is much more boring in this respect, users are more likely to form accurate intuitions. is defining a class the same as defining a function? What about functions implicitly defined when you define a class? __what__ is __with__ __some_words__? why do you need an empty file called init.py in the same directory as your actual code?
- ptx 3y ago> print f"are you {sure} you need parenthesis to call a function in python" This example doesn't call any functions. The print statement was removed in Python 3 and turned into a function, so you do need parentheses to call it and the example above is a syntax error. Python 2 (which had a print statement instead of a print function) didn't support f-strings. And f-strings, unlike JavaScript's template strings, are not function calls. In other words, yes, you consistently use parentheses to call functions in Python.
- xer0x 3y agoGood 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.
- jeremycarter 3y agoWait you're moving to Python? I hope you have benchmarked it.
- Waterluvian 3y agoI’ll take a stab at it: Python is good enough at everything.
- Koshkin 3y agoJupyter (Lab) is the best thing since sliced bread. (I don't know if similar environments exist for JS or Ruby.)
- MassiveBonk51 3y agoThere's language cores for jupyter for these languages. I can't speak on how good the experience is. Elixir has a first class notebook experience similar to Jupyter in Livebook. https://livebook.dev/ https://livebook.dev/
- fwungy 3y agoThe 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.
- tamimio 3y agoI 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.
- kriro 3y agoAll 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).
- seydor 3y agoI m still not convinced it won. If google dies tomorrow, how long would it survive
- __mharrison__ 3y agoIn a word... numpy.
- kazinator 3y ago> My impression is that in the ‘00s, Python and Ruby were both relatively new, dynamically typed, Your impression is wrong. Python goes back to 1988. It was known in FOSS circles in the 90's: a minority within a minority. The rise of the web exposed more programmers to FOSS, due to pretty much everyone in web eventually having to work with GNU/Linux servers. More developers than ever were suddenly exposed to cruft that only a few GNU/Linux and Unix geeks were previously privy to. Eric S. Raymond (ESR) was once influential, and wrote articles on Python; he helped draw attention to the language. For instance, this article in the Linux Journal https://www.linuxjournal.com/article/3882 https://www.linuxjournal.com/article/3882 For me, that article stands out in my memory as when I became more consciously aware of Python; that there may be something there. I suspect that the article had a big impact; I'm not the only one. People read rags like Linux Journal then. Sysadmins, developers, students, hobbyists.
- peteforde 3y agoWikipedia suggests that Python debuted in 1991, with Ruby following in 1995.
- kazinator 3y agoI haven't checked, but I seem to recall that Python started out as a successor to the ABC language in around 1988 or 1989 or so. The initial release may have been in 1991?
- giantrobot 3y agoPython, like Perl before it, also had some very well written books that were very accessible if you were interested in the language. Learning Python and Programming Python first came out in the 90s and then Dive Into Python was released in 2000. I think these really helped with Python's momentum when FOSS platforms were also building momentum and being taken seriously.
- jamesgill 3y agoData science/analysis.
- BeetleB 3y agoAdding 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. It is fairly well designed (well, at this point it may be overdesigned). A common remark by people learning Python was "I didn't know how to do X, so I guessed and it worked!" 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. And yes, I'll say it: Whitespace. The lack of braces and semicolons, and the semi-rigidity of whitespace just made it a lot easier to read.
- JAlexoid 3y agoReason 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 3y agoContrary 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.
- simlan 3y agoI 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...
- _8j50 3y agoThe 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).
- dkarl 3y agoA 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.
- TylerE 3y agoWell, 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 3y agoLike SQL, it's terrible in many ways, but in many more ways it's good-enough, commonly known enough, and/or accessible to others.
- stillsut 3y agoGoing 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?
- airstrike 3y agoSerious answer: the Zen of Python. It makes for a far better version of Ruby
- alerighi 3y agoTo 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.
- jacurtis 3y agoI always used the word "magic" to describe Ruby syntax. It was my biggest complaint with it too. RoR took that even further by adding even more magic through a framework, where simple functions did HUGE amounts of hidden work. I will say, my favorite feature of Ruby was the question mark in methods convention. For those that don't know, a common convention in Ruby was to put a question mark at the end of any method that returns a boolean. So for example you could write: if product.active? ... DO THIS THING It was fun and I enjoyed it. Behind the scenes it was just a method, but the question mark at the end was always fun to me from a readability standpoint. However, its really not all that different than the pythonic way: if product.is_active(): ... DO THIS THING Something about the question mark felt fun and magical.
- kuchenbecker 3y agoIt's the "just works" part of magic that's the gotcha. I lead a team with a multi EiB Hadoop cluster and magically list status and rename dir can only be done with more and more caveats as you scale.
- edanm 3y agoWhat 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 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.
- sebastianconcpt 3y agoBecause 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 https://www.youtube.com/watch?v=eGaKZBr0ga4&t=705s
- zem 3y agohaving 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 3y agoNo curly braces. I’m serious.
- DrBazza 3y agoIn 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.
- karmasimida 3y agoIt wins because it focuses on what people can do with it, not indulging itself with some cosmetics level syntax feature.
- scoofy 3y agoI 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.
- while_true_ 3y agoSame here, engineer with no formal CS training. A long time ago I would write macros with Visual Basic. When it came time to jump to a more robust language that is also cross-platform, Python was the obvious choice. It's readable, easy to learn, has great support and the PyPI library is huge.
- v64 3y agoMany 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.
- The_Colonel 3y ago> There's One And Only One Obvious Way To Do It From the external POV that's one of my pet peeves with the Python which also soaks into other aspects of the community. Python community seems almost religious and sort of self-righteous about how Python was designed and how things should be done. Other language communities are more open to (self-)criticism.
- dyeje 3y agoYou’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.
- john-tells-all 3y agoI 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.
- shrimpx 3y agoPerl5 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.
- a01bd76cbe4d9ba 3y agoYou want a Perl backend that is still maintained even now? Look no further. https://github.com/nsquarednz/jarvis https://github.com/nsquarednz/jarvis
- btbuildem 3y agoI'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. It's interpreted, which means you can futz around and prototype and get things working, hacking at it until it clicks. There's no hang-yourself-in-frustration build chains, nor even the need for reliable and responsible tooling - no overhead at all. 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.
- The_Colonel 3y agoI believe what you describe is basically a preference for a language you already know. I'm quite proficient in JavaScript and could repeat everything you say about ... JavaScript. OTOH I had to do things in Python a bunch of times, and it was always very frustrating.
- Daishiman 3y agoThe JavaScript ecosystem is objectively smaller. JavaScript doesn’t have a foothold in data science and ETL, nor deep learning, nor DevOps. There are no decent ORMs in JS, and Python has several. JS is poor for numerical and scientific programming.
- oraphalous 3y agoObligatory: https://xkcd.com/353/ https://xkcd.com/353/
- jacobsenscott 3y agoYou 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.
- rubyn00bie 3y agoGoogle 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).
- rdtsc 3y ago1) 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?”.
- sesuximo 3y agoPython was released first
- reddit_clone 3y agoOne 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.
- mempko 3y agoRaku is great but needs that killer use case. Raku is the best language for processing / parsing / generating text. I'm surprised nobody took it and created the best in class LLM toolchain with it.... langchain but better. Any projects out there trying with raku?
- jokoon 3y agoPython 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.
- Buttons840 3y agoCan 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 https://news.ycombinator.com/item?id=682364
- stephenitis 3y agoI wish I could favorite comments. Thanks for sharing this one.
- Buttons840 3y agoClick the time on a comment ("1 hour ago", "60 days ago", etc), that will focus you on the single comment and give you the option to mark it a favorite. You can access your favorites through your HN profile.
- deleted 3y ago[deleted]
- graypegg 3y agoWe 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.
- pookha 3y agoI'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.
- deleted 3y ago[deleted]
- acjohnson55 3y agoHere'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.
- asciimov 3y agoOne 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.
- imgabe 3y agoI 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.
- felipetrz 3y agoYou 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.
- Buttons840 3y agoPython 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://docs.python.org/3/library/optparse.html https://ruby-doc.org/stdlib-2.7.1/libdoc/optparse/rdoc/index.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 3y ago> 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 3y agoI 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 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.
- nurettin 3y agoPython 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.
- pirate787 3y agoPython didn't win. PHP adapted and remains the language that powers the Internet.
- ravenstine 3y ago- 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.
- jdlyga 3y agoBack 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. There's nothing necessarily wrong with Ruby. 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.
- harel 3y agoSome 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)
- contingencies 3y agorails 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.
- xupybd 3y agoThe 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.
- michael_j_x 3y agoFor ML stuff, it was a poor mans Matlab with great C and C++ bindings
- Saphyel 3y agoRuby 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.
- habibur 3y agoI 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.
- webnrrd2k 3y agoLots 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.
- tanbog5 3y agoSome 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.
- deleted 3y ago[deleted]
- _fdsfs12123 3y agoFunny 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 3y agopoor php is still ruling the web and still gets left out the convo
- mgl 3y agoMojo could be for Python the same breath of a fresh air as Kotlin is for Java: https://stratoflow.com/introduction-to-mojo-programming-language/ https://stratoflow.com/introduction-to-mojo-programming-lang...
- kiitos 3y agoPython 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 3y agoAnother reason is how much the standard library provided (csv, zip, so much). The XKCD comic says it all https://xkcd.com/353/ 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!
- Tommah 3y agoI 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/2007/04/22/python-up-ruby-down-if-that-runtime-dont-work-then-its-bound-to-drizzown.html 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_up_ruby_down_if_that_runtime_dont_work/ https://old.reddit.com/r/programming/comments/1kg8e/python_u...
- nsonha 3y agoPython 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
- zmmmmm 3y agoI 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.
- javajosh 3y agoPython 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.
- junofan 3y agoBDFL contained bullshit during a critical period.
- cdchn 3y agoPython has the cleanest syntax around. "Executable pseudo code." Ruby had too much magic and other nonsense (:symbols, $igils are $tupid)
- tptacek 3y agoServerside 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 3y agoPython 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.
- tetsuhamu 3y agoRuby 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 3y agoPython is only a titan if you include data science. In the web dev world it's dwarfed by Ruby and Node. Some possible reasons are: casual programmers learn python faster, "numpy" is fun to say out loud, and uh, can't think of any more.
- Daishiman 3y agoThere is much more web development going on in Python and Django over Rails.
- timinman 3y agoMy impression was that node took some of the momentum that Ruby had as a server-side language for web development.
- heavyset_go 3y ago20+ 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.
- airocker 3y agoI 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 3y agoI 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.
- anon373839 3y agoAround 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.
- cvalka 3y agoBecause ruby is perl 2.0
- femto113 3y agoSince 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.
- Kapura 3y agoVery 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.
- TrackerFF 3y agoBeginners 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 3y agoI'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...
- oaiey 3y agoIMHO, 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.
- stasge 3y agoReading 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.
- rtpg 3y agoDisclaimer: 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).
- anon291 3y agoPython 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.
- slowhadoken 3y agoNative 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.
- theodpHN 3y agoHow 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.
- User23 3y agoBecause worse is better.
- slantaclaus 3y agoPython won so much that your post questioning it and (gasp) supporting Ruby has been greyed out with downvotes
- MengerSponge 3y agoPython 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.
- segmondy 3y agoI 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.
- imgabe 3y agoThe REPL is huge and makes it so much easier to learn to program by trying out little snippets of code to see what they do. You can trial and error your way to a working program pretty quickly. Only Lisp has a better REPL.
- unethical_ban 3y agoI have come around to dislike forced whitespace. I don't think non-visible characters should be syntactically important, and spaces are thus overloaded by separating both within lines and defining functions. With linters how they are, a traditional semicolon makes things a lot more clean IMO.
- mixmastamyk 3y ago
- mulmen 3y ago“Perl is worse than Python because people wanted it worse.” - Larry Wall
- vijucat 3y agoI'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-with-python/ https://www.udemy.com/course/real-world-programming-for-kids...
- strzibny 3y agoI 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.
- unethical_ban 3y agoFor 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.
- dboreham 3y agoPython 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 3y agoRuby 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.
- dev_0 3y ago[dead]
- hkt 3y agoI 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.
- twangist 3y agoNeither Python nor Ruby is "English-like", and neither wishes to be. AppleScript is English-like, COBOL is English-like.
- greenthrow 3y agoYour 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 3y agoBack 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.
- simonw 3y agoI don't think your hunch here works. Why wasn't a teenager when they wrote that book. The Ruby community had very few teenagers involved when Rails was released. The Ruby and Rails communities did do a great job of attracting passionate, creative people. Those people weren't teenagers.
- gwbas1c 3y agoAll of the great teachers that I had as a teenager were adults. They knew how to relate to teenagers, just like Why's book.
- zerkten 3y agoI 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 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.
- nstart 3y agoIf 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 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.
- Qem 3y agoAnother beginner-friendly point for Python: it has IDLE, a barebones IDE, included as part of the standard library. It's unfortunate Ruby doesn't provide such niceties to the beginners out of the box, given it inherited a lot of the Smalltalks, the language family with the best programming environments ever.
- nstart 3y agoDefinitely. Forgot to mention this one. I remember running scripts through the IDLE till I learnt how to run stuff in the command prompt. So darn friendly.
- jandrewrogers 3y agoI 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.
- hadlock 3y ago> Python was much more scalable and maintainable language than Perl, This is a really excellent point. We were a Ruby/Golang shop and out of nowhere one of the sales engineers starts writing scripts in Perl. He wrote some really useful stuff, but the downside was that it was incomprehensible gobbldygook baked into 4 or 5 lines, and completely unmaintainable by anyone other than the original author. After he left we decided to rewrite all his code in Python/Ruby based on the general idea of what we wanted the inputs and outputs to be, rather than assign anyone to maintain the actual Perl code. Vs the 8-year-old analytics/data science codebase I had to unwind a couple years back, was written entirely in Python and was easily understandable from the first line and had been maintained by no less than six people over that time
- sanderjd 3y agoI 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 3y agoPython came way before JavaScript became good. And today it is on the way to lose as a back-end language to TypeScript and Golang.
- iepathos 3y agoPython 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.
- xtracto 3y agoI'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.
- sam0x17 3y agoThe 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
- zgs 3y agoIn 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.
- stevebmark 3y agoPython 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.
- bjt12345 3y agoFrom 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 3y agoPython 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.
- williamsmj 3y agoThis 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-growing-programming-language-due-to-a-feature-youve-never-heard-of/ https://jeffknupp.com/blog/2017/09/15/python-is-the-fastest-....
- rusticpenn 3y agoMATLAB made their software paid for research organizations. Many including Fraunhofer moved to python as an alternative.
- joss82 3y agoPython 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.
- qwertox 3y agoI 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 3y agoThe 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 3y agoPandas, Django, and Flask.
- est 3y ago> 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.
- deleted 3y ago[deleted]
- ivolimmen 3y agoIf you like Ruby I think you might enjoy Crystal as well.
- marmakoide 3y agoThe 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 3y agohttps://xkcd.com/353 https://xkcd.com/353
- flohofwoe 3y agoFor 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 3y agoPython 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 3y agoOperator 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 3y ago> 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 then 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 3y agoAs 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 3y agoPython 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”. Around that time NodeJS dropped and everything moved there. Python still had its niche in science/data. Computer Science departments started offering their intro CS classes in Python instead of Lisp. So it is no surprise why it exploded even more. A lot of Ruby-ism has found itself in Elixir. Which seems to slowly be gaining traction. All is not dead. It’s always just a matter of being in the right place at the right time. JS has always been a dumpster fire or garbage heap but it was in the right place at the right time. That’s the end of that.
- abareplace 3y ago[flagged]
- saikia81 3y agoYou are not asking for help. The comments on your critique are patient, and explain how to look at things different. Just because people disagree, does not mean they 'attack's you. Honestly, your critiques seem more like opinions. The comments are pretty spot on that these are not issues. Your perspective on the default data types is off though. This is not an attack. I simply disagree with you descriptions and opinions.
- deleted 3y ago[deleted]
- abareplace 3y ago[flagged]
- minorannoyance2 3y ago[flagged]
- sfn42 3y ago[flagged]
- allarm 3y agoI've checked the article and the comments are awesome, not sure what you're talking about. People disagree with you, respectfully, explaining why they think you're wrong. What did you expect from the "welcoming" community, ignoring the critique?
- abareplace 3y agoNot ignoring, but taking it seriously without demagogy and trying to prove that 2+2 equals to five.
- grigio 3y agofirst mover advantage
- okaleniuk 3y agoTen years ago, Python used to be excellent as a second choice for everything. So if you dabbled in machine learning, web, statistical analysis, text processing, system scripting, computer algebra, etc, it made sense to learn some Python even if your main job was in something else. So it grew a critical mass of people who know Python but not for the sake of Python itself, but for something else. And suddenly these people are invested. They want more, better, and faster. And then the demand pulls the proposition, and a decade later, Python is a big thing. I work in applied geometry. Numpy is good. Pandas is of little relevance for what I do. But what became a gamechanger is Numba. It's a run-time compiler that brings Python into native code for the target architecture, Inter, ARM, or even NVidia GPGPU. We used to do research in Python, invent algorithms there, and then rewrite them in C++ "for performance". The last time we did that, C++ version became 3 times as slow as the Python one when translated literally. We hid the fact by rewriting the algorithm itself, but that was the last straw. We now run Python in the cloud directly, and it rebuilds the native code for every piece of hardware we procure for the task automatically and I think this is beautiful.
- lukeck 3y agoIn my view Python’s strength is it prioritises making how things work clear while Ruby’s strength is it prioritises making intent clear. I actually wish there was something that struck more of a balance between these two philosophies. Ruby’s expressiveness is very nice but unless used carefully, can obscure what’s happening. Python’s clarity in implementation can make a piece of code clear in isolation but can get clunky.
- sidcool 3y agoMany reasons: - Easy to learn, no baggage of types. Less verbose. - New comer friendly. Newbies don't care about performance. Data scientists are usually not programmers and they loved it. - The ecosystem including IDEs, documentation, books, tutorials - Amazing library and package ecosystem. (pandas, pip, numpy, Django, pytorch, Virtual Env etc.) - CLI friendly and can be used easily for scripting.
- physicsguy 3y agoCan only speak from my experience. I learnt to program in C++ as part of a Physics degree and then went into research. At the time, people mostly used MATLAB or Mathematica for interactive stuff and C/C++/Fortran for higher performance bits. Mathematica was never paid for by the University while I was doing my PhD which meant I had to pay for it out of pocket, and MATLAB was clunky to do anything not matrix based. I started using Python just after version 2.7 came out because someone told me to download Enthought Canopy (a precursor distribution of scientific libraries for Python, like Anaconda is now) , "Hey, you can use Matplotlib and Numpy and get 90% of the way there by barely modifying your existing code". Then I came across things like FEniCs (finite element simulation framework) which didn't have a real equivalent in MATLAB/Mathematica world and which C++ world tools were difficult to use and tended to require a custom programming language. After leaving research I've worked as a developer and keep coming back to Python. Currently I work in web and use Django in my day job. I'm super comfortable and productive in the language.
- sxvtemp 3y agoGreat question, and one I've pondered a bit myself. Both Python and Ruby are cool languages, no doubt. But here's my two cents on why Python took off like a rocket while Ruby stayed more niche. Versatility: Python can do anything—web dev, data analysis, machine learning, you name it. That made it a Swiss Army knife for devs and businesses alike. Academia and Data Science: Python got super lucky with the boom in data science and AI. Libraries like NumPy, pandas, and TensorFlow sealed the deal for it in the scientific and research communities. Readability: Python's clean syntax is a godsend for newcomers and seasoned devs alike. This led to quick adoption and a growing community. Community and Ecosystem: The Python community is massive. A bigger community usually means better support and more libraries, which feeds back into its growth. Enterprise Adoption: Big names like Google, Instagram, and Dropbox using Python also adds credibility and draws even more people into the ecosystem. Ruby = Rails: Ruby got strongly tied to Rails. While Rails is fantastic for web dev, it kinda pigeonholed Ruby a bit. First-mover advantages: Python's been around a bit longer, and early adoption in academic circles helped it get a head start. Teaching Language: Python has become the go-to language for introductory computer science courses. That means a whole new generation is coming up already familiar with Python. Ruby's awesome and it’s got its own strengths (and die-hard fans!). But Python managed to position itself as a jack-of-all-trades, and that’s helped it become the titan it is today.
- meltyness 3y agoPython got a reputation for being good for quick prototyping. Python had an easy to use CLI and supportive docs that made it easy to throw things together. Case-in-point, the language literally includes functions like: dir That facilitate treating library objects as simple directories of functionality. Default arithmetic library supports APA. There's just a lot of stuff that's frictionless in Python, where Ruby has sprawling and unintuitive syntax, and mandatory programming constructs.
- theshrike79 3y agoRuby is too fancy with weird constructs. This is why I picked Python ~20 years ago. In ruby you can do fancy stuff like 3.times do |i| print i, " " end But why? Yes you save a few characters but also lose readability for people who aren't Rubyists. The same in Python is much more readable for people with no experience in the language: for i in range(5): print(i, end=" ") And this is a very simplified example, the complexity in understanding the Magic of Ruby goes up exponentially in real world code.
- znpy 3y agoPython has always been simpler and more linear to follow and above all way better documented. The official python website has all you need to learn the language whereas the ruby website has very little and you often have to resort to external websites and other third parties. Ruby would definitely benefit from a polishing campaign for its documentation.
- jinushaun 3y agoPython became the default teaching language—replacing Java in schools. For tech interviews, Python became the default (even if it’s not your main language) because it’s basically pseudocode.
- repulsivegoose 3y agoI wonder if maybe it’s not so deep. These days, Python is the 2nd best choice for just about anything, making it a sensible decision for just a about everything.
- sproketboy 3y ago[dead]
- hot_gril 3y agoJavascript is probably more popular than Python overall due to its dominance on web frontend and backend. Python is used more for data/ML stuff or general programming that doesn't fall into the web bucket, though it's fine for web backends too. Ruby's only killer app was eclipsed by NodeJS, and idk what else it was great for.
- eternityforest 3y agoRuby seems like it has Perl influence. It's something hackers might like, people who want to explore the possibilities of ideas and abstractions. Python spells out everything, it's all explicit, they don't have 5 ways to do the same thing. They try to have one and only one obvious way to do everything. It's a great language for programming as a means to an end. If you are writing code to make software, the same way and artist grinds pigment to make a picture, you don't want anything interesting, clever, implicit, etc. The software is supposed to be interesting, the code is supposed to be an implementation detail that doesn't really matter as long as the tests pass and it's not actually bad code that makes people sad to work with. My guess is that kind of thing builds momentum. Corporations use it. Educators use it. So other corporations and other educators use it. If you start out slightly more hacker oriented, you get more of a reputation of being in the same category of Perl, and your thing doesn't feel like the bog standard boring thing as obvious as 8 bit bytes. And people who want that stay away, and the ecosystems separate themselves out by purpose.
- thorin 3y agoInteresting to note the progression: Python was initially another scripting / better shell to rival Perl, but it took a long time to do so. It didn't really become popular until way later than a lot of other languages. I think this was mainly due to it's libraries, lightweight for beginners and being used in all kinds of different places. Ruby was really only know as "with Rails" for a lot of people and there are a lot of use cases other than web dev. C 1972 Bourne Shell 1979 Perl 1987 Python 1991 Javascript 1995 Ruby 1995 Java 1995
- PoloPing 3y ago[flagged]
- blablabla123 3y agoThe first time I tried Ruby was before Rails and I was quite astonished how much easier/more consistent it was to use than e.g. Perl. At that point I (and probably most people) considered it a scripting language, and used it for toying around and backup scripts. Eventually I also did Web development with it. It turned out Ruby's package management was quite hard to tame. Maybe not even more difficult than Python's today but at the time there was no RVM or any other virtualenv equivalent. (Or for that matter people who wrote their own.) Then after 1.8.7 there was the quite buggy and incompatible 1.9 which took away momentum, worsened the packaging situation to the point that 2 year old projects wouldn't work any more. (Some gems even disappeared!) I think that pretty much killed it. FWIW Ruby's FFI is pretty advanced and when you interface it from C it feels like duck typed C. Also back then I struggled writing a hello world in Python, so I think it's bad luck. On the other hand I think the Ruby community changed Software development quite a lot, making it more welcoming and defining how Web development should be done.
- racl101 3y agoI had these general impressions as a guy who started out with PHP who didn't know much at the time: Python really presented itself as a general purpose language for me. For example, as a language that could do a lot of the general scripting that you could do with Bash could but using a language that is much, much easier to read. Even though I can write it better now and appreciate how much faster it runs, at the time I had a really hard time writing and understanding Bash scripts. Ruby on the other hand, almost seemed as a language you had to learn as a pre-requisite to get to use Ruby on Rails. But if you did not care about Rails, then there was little incentive to learn it. Since I already used PHP for the web and had lots of experience with its respective frameworks (like Symfony) I did not feel the need to double up on a web language / framework combo. And, yes I know it is used in other frameworks/software but the perception that I had at the time was that Rails was the most popular use case for it. But then when Python really solidified itself for me as the truly general purpose language was seeing it as the language behind projects like Pandas, Numpy and Ansible for example and being able to use that software no problem. And all this in spite of the fact how readable both of them were and the fact they both have great package managers. So all those things being equal I chose to learn Python because it seemed like I get more out of it beyond web development. I will say this about Rails though, Ruby on Rails is one of the most influential web frameworks of all time and Laravel borrowed so much from it.