[HN Gopher] Ask HN: Why did Python win?
       ___________________________________________________________________
        
       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).
        
       Author : MatthiasPortzel
       Score  : 187 points
       Date   : 2023-08-29 14:48 UTC (8 hours ago)
        
       | Koshkin wrote:
       | Jupyter (Lab) is the best thing since sliced bread. (I don't know
       | if similar environments exist for JS or Ruby.)
        
         | MassiveBonk51 wrote:
         | There'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/
        
       | john-tells-all wrote:
       | I was there.
       | 
       | I learned Python first. I saw Ruby as a "similar language,
       | faster, more syntax-heavy, popular in Japan".
       | 
       | Python "won" because of Guido's focus on ease of use by non-
       | programmers. A bunch of scientists used it to steer long-running
       | computations in C, by binding the fast C math libraries with a
       | Python frontend. Python was so easy to use that new scientists
       | and interns could get started easily.
       | 
       | I don't know why Ruby has stalled out. Its "test first" culture
       | and of course Ruby on Rails, and Chef, are all excellent.
        
       | alerighi wrote:
       | To me Ruby syntax looks too magic. Python is much more simple to
       | understand, a person that doens't know python but another
       | language such as C or Java can write programs in like 10 minutes.
       | The only "strange" thing is the use of indentation for dividing
       | blocks, but it's something you easily learn in 2 minutes.
       | 
       | Another thing that helped python is the fact that you can do
       | fairly low-level operations in a very high level language. Python
       | gives you os-level API/system calls that otherwise you would need
       | to use a language like C to have access to. This makes python
       | great to do system programming: indeed a lot of system tools in
       | Linux where performance is not critical are written in python.
       | For this reason you can assume any Linux/UNIX system has a python
       | interpreter, and thus a lot of scripts and tools started to be
       | written in python.
       | 
       | It's also quite easy to call C code from python code, and vice
       | versa (for this reason python is used as a scripts/plugin engine
       | in programs written in other languages). This is the reason a lot
       | of scientific calculation tools are written in python, since they
       | have the algorithms implemented in C for maximum performance with
       | a python API to be able to be used easily.
        
         | jacurtis wrote:
         | I 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.
        
       | mydriasis wrote:
       | It writes like English and you don't have to think about memory.
       | Those two things are _huge_.
        
       | jl6 wrote:
       | I'm sure it helps that Python is perceived as one of the easiest
       | languages to learn (and the perceptions are largely correct), and
       | thus found itself as the default language in thousands of Learn
       | How To Program courses around the world. This constantly feeds
       | new users into the ecosystem, which has grown to a critical mass.
        
       | jmugan wrote:
       | I moved from Matlab to Python in grad school once my thesis
       | program got too big. It's open, which beats Wolfram. You don't
       | have to manage memory, which beats C/C++. And it has a lot less
       | boilerplate than System.out.println('Java').
        
       | fwungy wrote:
       | The much reviled Global Interpreter Lock(GIL) slowed python down,
       | but also made it really easy to write libraries for.
       | 
       | If you wanted to do something there was probably already a Python
       | lib for it. Nothing else had such a rich library ecosystem. If
       | you really need python to perform it is usually easy enough to
       | write the needed routines in a lower level language link it in.
       | 
       | Python grew because it was so easy and powerful enough. Now that
       | python loads are getting into substantial computing the
       | efficiency is becoming an issue.
        
       | beardyw wrote:
       | No language ever won. When I started COBOL had won, not so today.
       | Over the years various languages have won. Python is popular
       | today for many but not all applications. That's about all you can
       | say.
        
         | yCombLinks wrote:
         | Python is clearly the current winner. Not sure being pedantic
         | about what it means to be a winner adds anything
        
           | izacus wrote:
           | If there's a winner, it's still named "Java".
        
             | reducesuffering wrote:
             | Based on what?
             | 
             | https://madnight.github.io/githut/#/pull_requests/2023/2
             | 
             | https://insights.stackoverflow.com/trends?tags=python%2Cjav
             | a
        
             | yCombLinks wrote:
             | I was talking in the context of the Ruby/ Python/
             | interpreted language world of the parent post
        
               | gremlinsinc wrote:
               | if 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.
        
       | dottjt wrote:
       | As a self-taught programmer who started learning around 2015,
       | Python was the least intimidating to learn.
       | 
       | Although I'm a proficient JavaScript programmer now, the idea of
       | curly brackets were genuinely intimidating. Just something about
       | that made the program seem more complex than necessary, and
       | Python seemed really clean.
       | 
       | I also think the book `How to Think Like a Computer Scientist` is
       | a large part of Python's success for beginners. In the early
       | days, it was literally the only programming learning book that
       | clicked for me, and it was in Python. Up until then, programming
       | still felt esoteric.
        
       | Dowwie wrote:
       | Responsive 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.
        
       | shrimpx wrote:
       | Perl5 was king in the 90s and early 2000s for building web apps,
       | and as Perl5 faded, Python was the obvious contender and it took
       | over.
       | 
       | Perl5 was built more for CLI programs and text processing tasks,
       | like Awk. As the internet got bigger, Perl5's idiosyncrasies
       | became more evident. People wanted a cleaner and more structured
       | language that could remain readable in large code bases.
       | 
       | I remember building backends in the late 90s in Perl and yearning
       | for something more structured. Perl5 often just felt so hacky and
       | full of magic, often resulting in unreadable code. When I first
       | saw Python I was struck by how clean and uniform it was compared
       | to Perl5.
        
       | graypegg wrote:
       | We are in a verrrry similar boat! Always been into fiddling with
       | computers but got my first job in tech around 2013. JavaScript
       | and PHP. Only the past couple years have I messed around with
       | Ruby + RoR and I love it.
       | 
       | Every time I have to touch Python to mess around with anything
       | going on in the ML space, it just feels so clunky, in ways that
       | Ruby feels like it wouldn't have trouble with.
       | 
       | I think r_thanbapillai's top level comment is spot on. Ruby
       | became a "web" language because of the singular focus on Rails
       | (at least in the west) which hampered its growth in other areas.
       | It's not so much the language that makes a community but the
       | libraries people are inspired to build with it. Python
       | specialized in the "right" thing for its moment in the sun.
       | 
       | I do think we're slowly seeing Julia or other more purpose built
       | tools slowly eating python's numpy lunch.
        
       | rich_sasha wrote:
       | I think the middle growth was driven by the "second best at
       | everything" meme.
       | 
       | Python is not the best at most things but a close second or third
       | usually (system scripting, data munging, web programming etc),
       | meaning it is easy to get into the language for one use, then
       | continue using it for other things.
       | 
       | Ruby or Go feel like something that ended up specializing in web,
       | so even if they are better suited to it than Python, Python
       | benefits from more cross-pollination.
       | 
       | This will be especially true for small teams, where one language
       | has to cover all bases, and also where "areas" of programming
       | overlap. Need a REST server to serve up MP model results? By
       | virtue of being pretty close to best for both areas, it is
       | actually possibly the top choice overall.
        
       | pookha wrote:
       | I've always just thought it was just the universities. They train
       | people in Python, which meant that people who had low level
       | libraries written in C\C++ could wrap their utilities in Python
       | so as to capture a larger audience...But I also know that DHH
       | went after a lot of these enterprise software self-promoters
       | shilling "clean code" and they then turned around and bad mouthed
       | him and the Ruby programming language at conferences and podcasts
       | (for years). I can remember hearing from a few different shysters
       | that "ruby is a redundant language when you have python". That
       | sort of negative publicity can have a bad effect on an ecosystem.
       | My two cents.
        
       | btbuildem wrote:
       | I've been writing code since the mid-90's, probably in a dozen
       | languages or so over that timespan.
       | 
       | In my experience, Python is "easy" -- as in, you can quickly
       | achieve what you want. It doesn't get in your way with opinions
       | about types or data structures. You can rapidly create horrific
       | kludges that produce the results you want.
       | 
       | Not sure I'd say it's a programmer's language. It's like
       | javascript that way, but without the absurdity and the footguns.
       | It's overall intuitive, and has all kinds of handy shortcuts.
       | 
       | 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 wrote:
         | I 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.
        
       | Scarblac wrote:
       | Python got Numpy very early on, and other languages never got an
       | equivalent.
       | 
       | And then lots of things were built on top of Numpy - image
       | processing, reading GIS raster data, scipy, pandas, etc etc - and
       | they're all trivial to combine because it's all just Numpy
       | arrays.
       | 
       | Python also had a very friendly and approachable community from
       | the start, and great docs, while Ruby had its documentation in
       | Japanese only for some time.
       | 
       | Django is also top quality, imo. Similar to Rails. But it always
       | seemed Ruby was only good for Rails, whereas Python combines with
       | everything.
       | 
       | So as usual, it's not about the language, it's about the rest.
        
         | paulddraper wrote:
         | Rails 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.
        
           | rcarmo wrote:
           | I would dispute that. I always felt Rails was used by a very
           | communicative subset of web developers while the Django users
           | just contracted, delivered, got paid and moved on to the next
           | project without any hassle.
        
             | abhiyerra wrote:
             | I can confirm. A lot of Django apps out there. People don't
             | make a big scene about it, and it quietly powers a lot of
             | websites. I think one of the powers it has that no one
             | talks about is that you can do microservices within a
             | monolith.
        
           | capableweb wrote:
           | > 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%2F0.
           | ..
        
             | laurencerowe wrote:
             | And Django was far from the only Python web framework at
             | the time Ruby on Rails became popular. Django gained
             | popularity largely because it was seen as a Python
             | equivalent to Rails.
             | 
             | Before then Zope (on which the popular Plone CMS was built)
             | was probably the most widely used web framework in Python.
             | But there were many, many others too.
        
             | paulddraper wrote:
             | Fair enough, my information is outdated.
             | 
             | StackOverflow agrees. [1]
             | 
             | [1] https://insights.stackoverflow.com/trends?tags=django%2
             | Cruby...
        
               | byroot wrote:
               | If you properly scope to the Computer & Electronics
               | category to avoid matching "Django Unchained" the graph
               | is quite different: https://trends.google.com/trends/expl
               | ore?cat=5&date=all&q=%2...
        
             | avrionov wrote:
             | For people who are wandering like me, the big jump in
             | Django searches was the release of Django Unchained by
             | Quentin Tarantino on Dec 25, 2012.
        
               | [deleted]
        
       | edanm wrote:
       | What many others here are saying is correct. Python was fairly
       | popular, and considered a great language that good developers
       | wanted to develop in, way before Ruby became popular.
       | 
       | Just look at this article by Paul Graham, written in 2004, called
       | "The Python Paradox" http://www.paulgraham.com/pypar.html:
       | 
       | > I didn't mean by this that Java programmers are dumb. I meant
       | that Python programmers are smart. It's a lot of work to learn a
       | new programming language. And people don't learn Python because
       | it will get them a job; they learn it because they genuinely like
       | to program and aren't satisfied with the languages they already
       | know.
       | 
       | > Which makes them exactly the kind of programmers companies
       | should want to hire.
       | 
       | This was written more or less at the same time that Ruby on Rails
       | was first released. Clearly by then, people had known about
       | Python for a while.
       | 
       | That head-start led it to be more popular early on, except in
       | webdev circles specifically. But in the other circles, and
       | especially in Academia, Python was gaining popularity, which
       | helped it both get lots of great scientific libraries (making it
       | today's default "data" language), and also made it eventually
       | become a language taught in Universities.
        
       | dekhn wrote:
       | Because I loved C, liked C++, but hated writing complex programs
       | in either language (circa 1995) and somebody said "try python,
       | it's object oriented and easy to use" and I still use it today as
       | my preferred language for a wide range of tasks. it just feels
       | like a macro language on top of C/C++ in some ways. Numeric
       | Python, then numarray, and numpy transformed my way of working
       | with multidimensional data.
       | 
       | Perl: could not stand the syntax or the language philosophy
       | 
       | C++: too many footguns
       | 
       | TCL: a bit primitive for what I wanted to do
       | 
       | Java: ugh. just ugh.
       | 
       | Go: not targeted at my use cases
        
       | aaron695 wrote:
       | The other comments answer this well.
       | 
       | But I'll add Ruby on Rails and a lessor extent Ruby was pushed by
       | hipsters hard and people who didn't program but were internet
       | explorers.
       | 
       | Python just was. You'd never have not considered it a language.
       | 
       | I always thought having Python 2 and 3 held it back a decade. The
       | fact it won despite that means to me it was never a contest.
        
         | mixmastamyk wrote:
         | Yes, 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.
        
       | laurencerowe wrote:
       | I think Python's enduring appeal is down to the combination of
       | its very human friendly syntax (which drew on earlier work on the
       | ABC language at CWI) and its practical approach of wrapping
       | existing C libraries so it could be used as glue code for many
       | different domains.
       | 
       | By contrast I feel Ruby was very much a one hit wonder with Ruby
       | on Rails.
        
       | analog31 wrote:
       | I 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.
        
       | lacker wrote:
       | Ruby was never that great of a language. Rails was much better
       | than any alternative, though, and it brought Ruby along with it.
       | Basically every company using Ruby chose it because they wanted
       | to use Rails.
       | 
       | The main thing that has led to the decline of Rails is the rise
       | of no-HTML-just-an-API backends. Your web frontend development
       | stack is more likely nowadays to be, first you pick between React
       | or a similar framework, and then the backend just sends API data
       | and doesn't mess with HTML. This makes for better websites, and
       | it makes joint web and mobile development easier too, because
       | you're going to have to build that API anyway for your mobile
       | app.
        
       | dbtc wrote:
       | Ruby is fun, which is a priority for some
       | 
       | Like you, but you're in not the majority.
        
       | gte525u wrote:
       | Python had significant traction back in the late '90s (~1.4/1.5).
       | It was perl vs python vs TCL (possibly vs Guile) back then.
       | 
       | Cross platform and the ease of integrating to other codebases
       | (both extension and embedding) are two parts. Perl's transition
       | to Perl 6 seemed to hurt/fragment that community more so than
       | python 2000 did to python. TCL seemed to slowly die except for a
       | couple niche applications - possibly expedited by Sun's slow
       | demise. Guile never really ran well on non-*nix systems.
       | 
       | Fundamentally python had more C/pascal flavor than Ruby's
       | smalltalk's flavor. That made it easy to teach/adopt. A couple
       | big name universities moving from scheme to python for intro CS
       | helped too.
        
       | [deleted]
        
       | philwelch wrote:
       | > 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 wrote:
         | The 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.
        
       | andrewprock wrote:
       | This has been touched on in other comments, but I think it bears
       | highlighting.
       | 
       | The ability of python to integrate with C/C++ code went a long
       | way to making it a long term viable platform. If you needed
       | scripting you could code in regular python. If you needed
       | advanced control of hardware in your scripts, you could write a
       | python extension in C/C++ to gain access to that hardware. If you
       | needed high performance, or high parallelism, you could likewise
       | create an extension to solve those problems.
       | 
       | In this way Python was the best of both worlds. Elegant scripting
       | which could be combined with blazing performance and low level
       | hardware interfaces. This aspect of the language allowed it to
       | have a wide footprint (as opposed to just the browser) and to
       | leverage legacy libraries effectively - e.g. BLAS.
       | 
       | I personally did crazy stuff like: "embed a python interpreter in
       | a C program, to use python scripting within the program" back in
       | like 1999.
        
       | chombier wrote:
       | I would say Python won because IIRC it was meant to be a glue
       | language between C libraries (something between C and bash) from
       | the beginning.
       | 
       | This made it fairly easy for anyone to provide Python bindings
       | for existing C libraries, so users could enjoy a large number of
       | packages in order to get stuff done quickly.
       | 
       | Then of course, numpy/pandas etc.
        
       | huevosabio wrote:
       | Python grew out of a myriad of applications that built on hard to
       | replicate components, while Ruby relied only on web development
       | which is remarkably subject to fashion.
       | 
       | Python is very simple making it easy to learn. Thus, it became
       | more and more popular for fields where programming is not the
       | main task, like science. It is also very easy to extend with C.
       | So, these fields could bolt on time-tested scientific code into
       | their Python scripts.
       | 
       | Ruby seemed to be entirely tied to Rails.
       | 
       | When the 00s and 2010s came with needs for web development and
       | scientific computing for big applications (e.g. ads on social
       | media), there were multiple language options for web development
       | but really only one that made it easy to onboard academics into
       | the task of building software systems.
       | 
       | From there, it was just a feedback loop, and when deep learning
       | became a major field, the ML community was already knees deep in
       | Python, so it was hard to justify making tools elsewhere.
       | 
       | Meanwhile, it seems to me, that Rail's appeal (and with it, Ruby)
       | was taken by Node's promise of using the same language on both
       | server and client, and more generally diluted by the fashion
       | waves of web dev.
       | 
       | If you want to swap Python for another language in scientific
       | computing, you will soon find annoyances that certain packages
       | are missing, or don't talk to each other well, or aren't
       | optimized. If you want to swap Ruby for another language, you
       | just use the other language web dev library and that's it.
       | 
       | As an aside, Julia has been the promised replacement for Python
       | for over a decade. It tries and does replicate the package
       | ecosystem, the ease of use, extendibility, etc. It also goes out
       | of its way to be able to use Python packages out of the box. But
       | it just seems to be very hard to convince practitioners to go to
       | Julia for just some small performance changes.
        
         | jemmyw wrote:
         | > Python is very simple making it easy to learn.
         | 
         | I would argue that there's little difference between them in
         | ease of learning. I personally found Ruby easier because
         | everything being an object with methods and no free floating
         | functions felt more natural and easier to look up. i.e.
         | 
         | string.length
         | 
         | over Python
         | 
         | len(string)
        
           | ptx wrote:
           | It's easier than Java, though, where you have
           | string.length(), array.length and list.size(). In Python it's
           | always len(whatever). But maybe Ruby wins this one if it's
           | consistent in its method naming.
        
         | smashed wrote:
         | I agree. I've seen Python being taught in Physics and hard
         | science university cursus as an introduction to programming 15+
         | years ago.
        
           | pjmlp wrote:
           | When 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.
        
         | paulddraper wrote:
         | > Ruby relied only on web development
         | 
         | Chef, Puppet, Vagrant, Logstash, etc are not web development.
         | 
         | Ruby dominated (dominates?) DevOps tooling.
        
           | EamonnMR wrote:
           | YMMV, but I've only seen Rails fans use any of those.
        
           | tiberious726 wrote:
           | Back in 2012 there was no question that ruby was the language
           | of DevOps, then Ansible took over. Puppet was a true pain to
           | work with, and through at least version 4, their language
           | designers were simply wrong about what it meant to be a
           | declarative language (you could only declare each resource
           | once, they pretended/falsely believed that inference and/or
           | unification were incompatible with declarative languages),
           | but wow was it powerful to maintain dependable state on long
           | lived servers
        
           | gaganyaan wrote:
           | I think their comment still holds. Those are all tools that
           | you use, and mostly don't care what language they're written
           | in. When you've got to write Ruby, it was predominantly in
           | the context of RoR.
           | 
           | I think also that dominance has mostly faded. When I think of
           | languages that dominate devops now, I think of Go, and I say
           | that as someone that dislikes Go.
        
           | JAlexoid wrote:
           | I'm sorry, but for me it seems that Go has is taking the lead
           | in adoption rates for devops tooling.
           | 
           | Ruby isn't the go-to language there anymore... probably
           | because GoLang compiles statically.
        
             | adw wrote:
             | The k8s world is Go Central, so that probably has a lot to
             | do with it.
        
           | kstrauser wrote:
           | Ansible is Python, Terraform is Go. Those are 2 giant
           | projects in DevOps.
        
         | MatthiasPortzel wrote:
         | > Ruby seemed to be entirely tied to Rails.
         | 
         | I'd be interested in going one step further and asking why that
         | was. Rails is great, but so is Ruby, but normally a great
         | library like Rails helps attract developers to the language.
         | Rails is the only example I can think of where a widely popular
         | library (ostensibly) leads to fewer users of the language for
         | other purposes.
        
           | EamonnMR wrote:
           | I wonder if it's because Rails creates such a specific set of
           | expectations that when you actually try to do something
           | without it you run into problems. "Oh, that's only a rails
           | thing? I thought that was a ruby thing..."
           | 
           | Ruby's monkey patching convention might make this worse.
        
           | dizhn wrote:
           | Not exactly the same thing but flutter and dart have a
           | similarly weird relationship too.
        
       | sebastianconcpt wrote:
       | Because it managed to produce frictionless adoption in academia.
       | All the rest is downstream of that. MVPs in entrepreneurial
       | initiatives are done with that. RESTful APIs are based on the
       | prototypes that come from academia. Good libraries for data
       | processing of lots of data required by academic studies became
       | easily adopted there. So a less-effort/easiest-convenience law
       | inside academia made it win.
       | 
       | BTW, if you enjoy Ruby, watch this:
       | https://www.youtube.com/watch?v=eGaKZBr0ga4&t=705s
        
       | james-revisoai wrote:
       | Ruby was more popular, especially when Rails exploded. It was
       | great for scrappy startups, that didn't need Java level quality
       | (and costly time) nor the risks of PHP 4.
       | 
       | The python modules eco-system lead to the stake change. Scikit-
       | learn, Pandas and Numpy made it so useful for visualisation,
       | research, old school modelling ML. Writing and saving files was
       | simple. Making your own module took 2 files with 4 lines of code.
       | How easy.
       | 
       | After establishing use cases in Python 2, which already allowed a
       | lot of C code in practise for speed, Python 3 changed everything
       | with a simpler language that makes it clear what is normal and
       | weird. You might dislike [:-1] at first, but you definitely know
       | it's weird compared to other languages, so you can know what to
       | search for. Not true of abstractions in some other languages like
       | Ruby, for migrating devs.
       | 
       | Then Python caught with Tensorflow/PyTorch a real wave of being
       | the place to go. Kaggle involved 100,000s all coding in Python
       | for data science in the latter half of the 10s. It did this at
       | the same time as the LAMP stack and LAMP pre-installed VPS
       | running cPanel were dying to React/node.js and PaaS approaches on
       | the one hand, and big cloud providers on the other. So suddenly,
       | there was not an easy default 'nix environment with PHP to rely
       | on being available so easily, and adding python to an existing
       | server is super easy (and Flask/Django easy to grep), making
       | adding a backend for ML or whatever, very easy too. Ruby wasn't
       | even on the playing field for many of these use cases.
       | 
       | I think a last small impact was that Ruby was misused where shell
       | scripts could have worked. Many people made Ruby cli tools for
       | their internal team, when shell scripts would have been fine -
       | this frustrated some of their peers away from Ruby. There is no
       | difference from Python here, but I just noticed it more.
        
       | oraphalous wrote:
       | Obligatory:
       | 
       | https://xkcd.com/353/
        
       | acjohnson55 wrote:
       | Here's my take.
       | 
       | Ruby essentially stole the thunder from Perl and PHP as the
       | language for back-end development with Rails. But with Django,
       | Python pretty quickly had a more or less equivalent web
       | framework.
       | 
       | Here's my recounting of history:
       | 
       | - For about a decade, Rails remained one step ahead on the
       | cutting edge of web development. Thought leaders like 37 Signals
       | / Basecamp constantly rolled out innovations through Rails,
       | appealing to the most forward-thinking web devs. But Python was
       | never far behind.
       | 
       | - I would also argue that Python is an easier to understand
       | language. Ruby encouraged the development of DSLs with its
       | second-class functions / block syntax, but Python tried hard to
       | keep its core language simple and emphasized explicitness.
       | 
       | - Meanwhile, the simplicity of Python's syntax made it very
       | appealing for developing data tooling, competing with a bunch of
       | expensive proprietary tools, like MATLAB. This exploded Python's
       | userbase.
       | 
       | During this period, I would say Ruby was the hotter language for
       | startups, but Python had a bigger userbase, as the more middle-
       | brow option.
       | 
       | Starting around 2015, both languages started to see other
       | languages encroach on their web dev moat. Node was better suited
       | for simple microservice APIs. People got into typed programming
       | for its perceived advantages. Compiled languages took on a lot of
       | the high-performance systems.
        
       | Stranger43 wrote:
       | Python kind of had three things that really mattered, an culture
       | of "one correct way", an invisible but conservative type system,
       | and an style guide build into the language an dictated from the
       | language designers in the form of significant whitespace and
       | PEP-8.
       | 
       | Ruby could have been a contender but still had some of the "there
       | is more than one way to do things" left over from perl(ruby was
       | kind of an pragmatic alternative to the "real soon newer" of
       | perl6) and it's a bit more dynamic than python in how it handles
       | variable internally.
       | 
       | And the field of academic data crunching was hurting badly from
       | the fact that the two only viable options for most entry level
       | researches was Excel/VisualBasic or PERL so everyone wanted some
       | level of structure which the python community led by Guido
       | provided, once people begun to settle on bumpy and pandas.
       | 
       | And pythons popularity definitely grows from the fact that it's
       | what non programmers learned as an alternative to
       | Excel/SPSS/SAS/Matlab(all of whom are expensive proprietary
       | tools) in classes focused on analyzing data.
        
       | zem wrote:
       | having used both ruby and python extensively, my guess is that
       | what gave python an edge is better support for namespacing and
       | stricter adherence to local scoping. it is far easier to read a
       | largish python project and easily see where every symbol the code
       | uses is defined; ruby makes it a lot harder because by default
       | everything is tossed into one big top-level namespace and
       | imported implicitly.
       | 
       | concrete example:
       | 
       | python:                   foo.py:           def f():
       | ...              bar.py:           import foo           x =
       | foo.f()  # very clear where f comes from, just look up foo.py
       | 
       | ruby:                   foo.rb           def f             ...
       | bar.rb           require 'foo'           x = f  # grep through
       | the code if you want to know what f is
        
       | jamesgill wrote:
       | Data science/analysis.
        
       | p1mrx wrote:
       | Python's old as dirt; it even predates Linux:
       | https://en.wikipedia.org/wiki/History_of_Python
       | 
       | Sometimes the key to success is to just be adequate for a really
       | long time.
        
         | mmphosis wrote:
         | Python 0.9.0 February 1991
         | 
         | 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
        
         | chinchilla2020 wrote:
         | > 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
        
         | deepsun wrote:
         | Well, Delphi is still adequate, but others got more popular.
        
         | EdwardDiego wrote:
         | > 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 wrote:
           | What, no Dr. Pepper? I'll just drink water, then.
        
       | soumendra wrote:
       | People seem to be forgetting that in the first few years of
       | Kaggle, R was the language of choice, not Python.
       | 
       | That changed very fast once deep learning arrived on the scene.
       | Plus the Python ecosystem kept getting better.
       | Google/tensorflow/python was the final nail in the coffin, and
       | the ecosystem had irreversibly shifted to Python.
        
       | BeetleB wrote:
       | Adding my 2 cents:
       | 
       | Python was not relatively new in the early 00's, but its
       | popularity really started taking off around that time. It is
       | older than Java and Javascript.
       | 
       | Ruby became big primarily because of Ruby on Rails. Python was
       | already big before Django came around. In fact, one of the
       | reasons Django exists is "Python is cool, and we need a good web
       | framework for it".
       | 
       | Why was it already popular? My guesses:
       | 
       | Very easy for new programmers, but enabled you to build fairly
       | powerful stuff with it (unlike, say, BASIC). Eric Raymond, around
       | 2000, wrote an article on why he loved Python, and the main
       | takeaway was that within a day or two of encountering it, he was
       | already building useful scripts with it.
       | 
       | 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.
        
       | jacobsenscott wrote:
       | You had to choose between python and perl for scripting, so the
       | choice was obvious. However it wasn't considered suitable for any
       | type of complex application at the time (no scripting language
       | was). Ruby wan't really on the radar when python was becoming
       | popular. Also python billed itself as a simple teaching language
       | which attracted a lot of non-programmers who were intimidated by
       | C and Java. It just kind of snowballed from there.
        
       | mixmastamyk wrote:
       | Weird/ugly syntax always turned me off ruby and perl. Js a mess,
       | now with good parts.
       | 
       | Unfortunately Python has a lot more colons than it used to, and
       | has gotten less readable recently.
        
       | htrp wrote:
       | In scientific computing, Python also "won" versus R, primarily
       | because of the deep integration with SWE concepts and the ability
       | to wholesale lift concepts from other languages through the
       | ecosystem.
       | 
       | I'd argue numpy/pandas are so fundamentally different from base
       | python that you need experience in those as well.
        
       | tamimio wrote:
       | I remember when python started, perl was there, and when I wanted
       | to write scripts for some pentesting, perl was the choice over
       | python. But I think the whole "data scientists" crowd is what
       | made it popular and mainstream, they are usually non-programmers,
       | and looking for an easy way to manipulate the numbers, speed or
       | performance isn't really the priority, that use case is fair,
       | what is not good is the other crowd, people who want to use
       | python for everything and shove it everywhere, backend!? Sure,
       | embedded?! Absolutely, heck even frontend I saw some are trying
       | to use it and marketing it "pure python".. even ML I believe we
       | would be at a better stage of Python wasn't the main tool used in
       | that domain.
       | 
       | I can't say much about ruby, barely used it, but if I were you I
       | will look at Go, it's definitely better than Ruby and still ahead
       | in terms of performance, not the top one but for its easy of use,
       | it is probably the best choice.
        
       | rubyn00bie wrote:
       | Google used Python; so, a LOT of folks figured that decision was
       | the best one because "Google used it." Google also chose to
       | employ Python's BDFL Guido van Rossum at a key time (2005);
       | which, pushed at least perception of the language forward.
       | Google's support is likely a key factor in the use in data-
       | science, but I don't know the dates/timeline for that as well.
       | 
       | Additionally, during that time the Ruby-core team seemed less
       | focused on performance and more focused on ergonomics. I think
       | the height of this was refinements; which, to my naive
       | understanding were (are?) a real PITA to support/implement for
       | the non-MRI implementations of Ruby. The complexity of the
       | language probably turned off folks who wanted a dynamic language
       | but wanted it to be fast (which is I imagine how all the
       | different implementations of python came about).
        
       | Ekaros wrote:
       | Because Python is not horrible general purpose language. In the
       | end not everything is web.
        
       | orasis wrote:
       | No curly braces. I'm serious.
        
       | Someone wrote:
       | > My impression is that in the '00s, Python and Ruby were both
       | relatively new
       | 
       | They were, but Python is close to 5 years older than Ruby
       | (February 1991 vs December 1995), so in the '00s, Python was
       | significantly older than Ruby.
       | 
       | Ruby also was more or less a Japanese-only thing until around
       | 2000.
       | https://en.wikipedia.org/wiki/Ruby_(programming_language)#Ea...:
       | 
       |  _"In 1999, the first English language mailing list ruby-talk
       | began"_
       | 
       |  _"In September 2000, the first English language book Programming
       | Ruby was printed, which was later freely released to the public"_
       | 
       | In contrast, Python was posted on alt.sources from the get-go (ht
       | tps://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 wrote:
         | > 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)
        
           | KerrAvon wrote:
           | Ruby's English documentation remains terrible, unfortunately.
        
         | tiberious726 wrote:
         | Early on, at least English speaking ruby had an extremely poor
         | culture around documentation. Code was barely commented and
         | "the ruby way" was to use single character variable names
        
           | masklinn wrote:
           | And the culture of metaprogramming and monkey patching didn't
           | help.
           | 
           | If the documentation is bad you can read the source, but if
           | you need to grok 3 layers of metaprogramming living in
           | unpredictable locations before you can do that there's no way
           | to advance (practically).
        
       | rcarmo wrote:
       | Way before the data science trend, I started using Python 1.2
       | because I could do quick, reasonably fast, and superbly readable
       | scripting. I stuck around through 2.x because I could interop
       | with C libraries via Cython and write very solid, readable and
       | maintainable web services (I used to contribute to a Python SOAP
       | library), and I once replaced a hideous amalgamation of PHP and
       | Perl with a event-driven Python API service that was superbly
       | efficient by comparison.
       | 
       | But the reason I stuck with it was quick turnaround and solid,
       | maintainable code.
       | 
       | When I was at a local ISP/Yahoo-style portal in the 2010s, it was
       | fashionable to run our own music and storage services. One of our
       | teams implemented a Dropbox clone (called MEO Cloud) that was
       | API-compatible (and had a Python client that I helped test).
       | 
       | At that time, we had a resident music streaming service that had
       | a massive storage array on-premises, and we had a branded music
       | streaming app to go with it. We wanted to implement a Shazam-like
       | functionality, so I borrowed two big multicore Xeons, built an
       | audio fingerprint indexer fot it based on a (now defunct) OSS
       | library, and indexed the entire thing (some hundred million audio
       | files) with Celery. It took me 3 days to write the first version,
       | and two more to tweak things (fingerprinting was done in C++, and
       | the only real constraint was datacenter network).
       | 
       | At that time we had a lousy experience with Rails and Ruby. I was
       | using Basecamp and was interested in it (plus I wrote quite a bit
       | of Ruby for Vagrant and Puppet), but the people we hired to do
       | two or three Rails projects never managed to deliver anything
       | usable or maintainable (since we were mostly a PHP/Java shop when
       | it came to front-ends, reliability and scalability were
       | paramount, and gems were hell to deploy and troubleshoot at the
       | time).
       | 
       | I moved to Python 3 with minimal hassle (perhaps because I took
       | great care in the dependencies I picked), adopted asyncio to
       | great effect (I use my own asyncio code to batch writes to Azure
       | storage these days), and all the while it has remained a very
       | enjoyable, readable language (except when I come across poorly
       | written OOP code that reads like Java fanfic).
       | 
       | My own coding style is closer to LISP/functional programming (I
       | am actually refactoring a piece of code I wrote eight years ago
       | in Hylang, the perennially under construction LISP-equivalent),
       | and I love virtualenvs, the AST, the way I can use decorators to
       | modify code behaviour, and, of course, the fact that today I can
       | run and work in it everywhere (I have multiple interpreters on
       | the iPad, for instance).
       | 
       | I could go on, but I've essentially been using Python as a mix of
       | C/C++ glue, some fairly involved functional programming and a lot
       | of multi-processing and concurrent code (I tend to push the
       | interpreter to the limit when I can't use Cython). And I even
       | wrote my own PasS on 1500 lines of it: https://github.com/piku
       | (which I still use today).
       | 
       | From where I'm sitting, Python won because it is a great,
       | maintainable glue language with some pretty much rock solid
       | libraries (not just the standard library). Bottle and Django come
       | to mind, although these days I'm more into aiohttp.
        
       | asciimov wrote:
       | One issue that sticks out to me is that 20 years ago it was hard
       | to get Ruby and Rails installed on a Windows XP System.
       | 
       | While the friction of installation isn't the sole reason why Ruby
       | isn't as popular as Python, it did leave a bad impression on many
       | devs as they shifted their projects to PHP.
        
       | JAlexoid wrote:
       | Reason is simple - Ruby is not good enough and lags in many,
       | many, areas.
       | 
       | Ruby was an unknown till the RoR was introduced. And the reason
       | why RoR was so easy and popular, was Ruby's biggest shortfall -
       | excessive metaprogramming. The automated creation of all of the
       | CRUD operations was definitely a kick in the... of Java and many
       | other languages that lacked such ability. But that comes with all
       | of the readability downsides, when "programming by convention"
       | lacks a commonly understood convention. (Scala also suffers from
       | it, just that Spark works so well for majority of it's use cases)
       | 
       | The worst part for Ruby, was that none of the features that RoR
       | brought were hard to implement in other languages. Others caught
       | up and Ruby didn't get enough windfall to keep sailing.
       | 
       | Then there was the community, that RoR attracted in the early
       | days... the best way to describe it was - toxic.
       | 
       | > how fun and easy to use it is
       | 
       | First impressions are deceptive. When RoR was getting popular,
       | many people who said the same typically showed me an example of
       | some functionality implemented in just one line. Which is not
       | exactly a great case for a programming language.
       | 
       | As for Python - it just grew steadily. Building the fundamentals
       | and spreading. Having strong opinions from a single person made
       | Python very easy to read and understand. It's by far the easiest
       | popular language to use to demonstrate concepts to anyone -
       | there's a very gentle learning curve. The community, tooling and
       | documentation - are considerably better than Ruby's.
       | 
       | Remember that there are really beautiful expressive languages
       | that make people fall in love with... but syntax is just one
       | small part of it.
        
       | singhrac wrote:
       | To offer a slightly different perspective than just "ecosystem",
       | I learned Ruby a few years after Python, and found it kind of
       | annoying, in that many Ruby programmers tend to invent their own
       | DSLs and little hacks because the language is so flexible. I know
       | many programmers love Ruby for class_eval, but it really makes
       | codebases hard to read, and code is read more than it is written.
       | 
       | Python has honestly had some opportunities to die out (2->3
       | transition, type hinting missteps, incredibly slow, etc.) but
       | survived because writing extensions was always easy and it was
       | taught a lot in universities.
        
       | johnea wrote:
       | What exactly did it win?
       | 
       | The prize for greatest number of incompatible versions?
        
         | jeremycarter wrote:
         | It won being the slowest, and most environmentally unfriendly
         | language.
        
         | rcarmo wrote:
         | I'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.
        
       | imgabe wrote:
       | I started programming around 2007. I actually wanted to get into
       | Common Lisp, because I was heavily influenced by Paul Graham, HN
       | and early Reddit. I did try a couple of web frameworks with
       | Common Lisp, but didn't get very far.
       | 
       | Ruby on Rails was very big at the time, but I ended up choosing
       | Python for a couple reasons. Python was a bit older, it already
       | had a reputation as a scripting language for system
       | administration. It had more libraries like Numpy and seemed like
       | you could do more things with Python. You could script, write
       | desktop apps, use it for data science, while Ruby was pretty much
       | just for web dev.
       | 
       | Even back then there was a huge ecosystem of Python package and
       | it seemed like anything you wanted to do with Python, there was
       | already a decent library available for it. So it seemed like you
       | had more options learning Python. Django was also just coming out
       | at the time, so you could do web dev with Python too. Then Reddit
       | rewrote their site and switched from Common Lisp to Python, so
       | that seemed like a good endorsement too.
       | 
       | Python became as big as it has because Machine Learning / AI
       | exploded and Python was there to benefit from that. Numpy /
       | Pandas / Jupyter Notebooks etc. gave everyone who wanted to learn
       | ML/AI FREE tools that were as good or better than Matlab /
       | Mathematica / SPSS or other software that cost thousands of
       | dollars. Grad students are poor. Maybe their school has a Matlab
       | license they can use, but they probably can't install it on their
       | personal laptop, so they used Python instead, wrote all of the
       | influential papers about ML using Python, then anyone else who
       | wanted to learn from that installed Python and so it goes.
        
       | felipetrz wrote:
       | You started using Javascript after they fixed it with ES6. When I
       | started working with Python, I had just left a NodeJS project in
       | ES5 callback + prototype hell and didn't want to get anywhere
       | near Javascript until they added proper scoping rules and
       | classes.
        
       | ketralnis wrote:
       | There's pretty much never a "why". Fashion is fashion.
       | 
       | You can look back at some things that occured and say "well it's
       | because it's easy" or whatever, but to be rigourous you'd have to
       | also apply that to the languages that _didn't_ win, and the
       | reasons that they didn't win to Python, and at best there's loose
       | correlation.
       | 
       | This is the same as people that point to "why" billionaires are
       | billionaires. There's a whole lot of luck to it that you can't
       | discount.
       | 
       | Further, I'd question the premise. It's clearly the first thing
       | that people reach for in ML and in the top 3 for web backends.
       | But it hasn't always been that way and it won't always be.
       | Programmers have way too much ADD and contrarianism for any such
       | state of affairs to last for long. And in other spaces and even
       | in other social circles it would be unheard of.
        
       | Buttons840 wrote:
       | Python and Ruby both have an optparse library in their standard
       | library. Compare the documentation for yourself:
       | 
       | https://docs.python.org/3/library/optparse.html
       | 
       | https://ruby-doc.org/stdlib-2.7.1/libdoc/optparse/rdoc/index...
       | 
       | I learned Python 2.3 almost 20 year ago, and the standard library
       | documentation in Python has always been just as good. As a
       | beginner I found Python's documentation very helpful, I could
       | read the documentation like a tutorial, like a book, a good
       | teacher. To this day I still look at the Python regular
       | expression documentation whenever I'm using a regular expression
       | in any language. I learned regular expressions from the Python
       | documentation, there was literally no blog or tutorial I found
       | more approachable than the Python documentation when I was very
       | first learning regular expressions.
       | 
       | Ruby had, and still has, a list of methods for documentation.
        
       | 0x6461188A wrote:
       | There is no win. This is an infinite game.
        
       | rdtsc wrote:
       | 1) Because it was a better Perl.
       | 
       | 2) The single CPU speed was doubling every 18 months almost. Wait
       | a few years, stick the program a new Pentium III or whatever and
       | you got a nice speed boost.
       | 
       | 3) Batteries included. It was huge quality of life improvement.
       | Want to traverse directories, parse ini files, send emails,
       | socket programming, even edit audio files --- it was all there.
       | 
       | 4) Repl. Huge improvement over other existing popular languages
       | at the time. Especially when ipython came about.
       | 
       | 5) No curly braces. People were sick of Java and C++ verbose
       | syntax. They were seen as old and crusty by that time so they
       | wanted something new. "Why do I need 30 lines of code to open and
       | read a file?".
        
       | dragonwriter wrote:
       | > 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.
        
       | madmountaingoat wrote:
       | Contrary to what many have said I think Ruby's popularity started
       | to rise a bit before Rails. It got an earlier bump from being
       | talked about in the 1999 Andrew Hunt and David Thomas book The
       | Pragmatic Programmer.
       | 
       | As for why it beat our Ruby; in those early days Python tended to
       | win the performance comparisons. That led to people using it for
       | more demanding data tasks, which in turn led to more libraries
       | for those sorts of domains. The parallel growth of jobs demanding
       | those capabilities (data analytic and AI), cemented its
       | supremacy.
       | 
       | That all said, if I need to hack a script together to automate
       | some development task - in the vein of what Hunt and Thomas
       | described back in 1999, I still reach for Ruby.
        
       | jacobgorm wrote:
       | Same reason Pascal lost to C. Life is too short for BEGIN and
       | END.
        
         | JAlexoid wrote:
         | Not 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 wrote:
       | I have never encountered a language as easy to pick up and do
       | cool stuff with as Ruby is. Even after years of working with it I
       | still find Python to be a bit of a mess. I think there was an
       | article years ago about how some people liking a product means it
       | is going to die? I'm pretty sure that is me for technology.
        
         | fictkgyicf wrote:
         | https://arstechnica.com/science/2015/12/certain-customers-sp...
        
           | throwawa14223 wrote:
           | It 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.
        
           | alpaca128 wrote:
           | > 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 wrote:
         | I'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.
        
           | throwawa14223 wrote:
           | That's word for word my experience with Go. I wonder if
           | people are different enough that programming languages cannot
           | be one sized fits all?
        
             | johannes1234321 wrote:
             | Experience between people differs. Problems they want to
             | focus on differ. The environment changes.
             | 
             | Maybe in hundred years or so software development will
             | somewhat settle, but just look at something trivial like a
             | hammer ... there are so many different kinds and some have
             | their favorite brand.
        
       | simlan wrote:
       | I am one of the likely millions of people that got sucked into
       | python for its accessibility and powerful data manipulation
       | libraries. Granted I started in the mid aughts with web scraping
       | and other stupid endeavours. That user base growing out of
       | matplotlib/numpy later pandas at a time when data literacy got
       | more important is I think the major driver of its success now.
       | 
       | Also does not hurt that it was designed as a teaching language at
       | first. Nowadays reading some of the code that is out there I feel
       | like I have no idea what is going on. Type hints and that way
       | some libraries use it makes my head spin sometimes...
        
       | sesuximo wrote:
       | Python was released first
        
       | dannyobrien wrote:
       | This maybe chicken-and-egg, but Google standardised very early on
       | on Python (along with Java and C++) for their internal work, and
       | sponsored a lot of the open source infrastructure. So even though
       | Ruby attracted a lot of attention for a big chunk of time, there
       | was no diminishing in the baseline popularity and functioning of
       | the Python ecosystem.
        
       | ah27182 wrote:
       | I felt that some of your questions, as well as the general
       | history of popular programming languages, were well laid out in
       | this talk: https://youtu.be/QyJZzq0v7Z4?si=hcPgL_LhWVTtjBdt
       | 
       | TL;DW: The presenter mentions that Python experienced a slow but
       | consistent growth trend, leading to its current prominence. Other
       | points he highlighted about its success align with much of the
       | sentiment expressed here.
        
       | DrBazza wrote:
       | In the early 00's in the banks (and other places): Perl was
       | everywhere on the server side, and generally horribly
       | unmaintainable because of TIMTOWDI. On the client side Visual
       | Basic was everywhere. The stars aligned: on the server Python was
       | easier to write, only one way to do it (sort of), and on the
       | client, Python was in some ways similar to Visual Basic (not
       | character soup), and was adopted there as well. And to a lesser
       | extent, Python was also more 'write once run everywhere' than
       | Java.
       | 
       | To quote someone else here, it wasn't the best language, but it
       | was the second best language, and hit the sweet spot for so many
       | domains.
        
       | vb-8448 wrote:
       | In python you just write your business logic. For any "low
       | level"/non-business aspect, you already have great stdlib and
       | rich ecosystem of third party packages.
       | 
       | People care delivering features rather than design and build the
       | best in class architecture.
       | 
       | I wish javascript adopt the same python philosophy, rather the
       | actual "spaghetti mess".
        
       | treprinum wrote:
       | Academics started pushing it and it replaced MatLab for many of
       | their tasks. Then ML started exploding and that was already all
       | in Python.
        
       | zdw wrote:
       | There's a joke that is roughly "Python is not the best language
       | for any particular task, but is nearly always the second best
       | language for that task" - it's a jack of all trades language.
       | 
       | Because of this, lots of people learned Python, and then applied
       | it in many different areas, and it just became more prevalent and
       | useful.
        
         | agumonkey wrote:
         | yeah 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
        
         | screye wrote:
         | > 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
         | 
         | Amen
        
           | The_Colonel wrote:
           | > Python basically solved this problem by wrapping around C
           | code
           | 
           | I would rather call it a work-around. Having to switch to a
           | vastly different language to get halfway decent performance
           | is hardly a good solution.
           | 
           | It's not a rare thing in normal applications that you need to
           | have some routine fast and there's no pre-built C solution
           | for it.
        
         | earthboundkid wrote:
         | I 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.
        
         | The_Colonel wrote:
         | > Python is not the best language for any particular task, but
         | is nearly always the second best language for that task
         | 
         | The "second best language" is false, it's just usable for a
         | wide variety of tasks. Just like many other languages, but
         | specifically not Ruby.
        
       | kriro wrote:
       | All imo but in the beginning Python took Perl marketshare for
       | scripting because it was simply less "esoteric". 10 Python
       | programmers wrote similar programs to solve the same task whereas
       | 10xPerl programmers would be more creative. All while coming with
       | "batteries included" which helped to get stuff done quickly. And
       | Python has always played well with C so you could optimize if
       | need be.
       | 
       | At the same time, Python was a pretty early adopter for the
       | server backend (and stuff like Zope existed) and also had great
       | interopt with databases but PHP was a stong contender/#1. I'd say
       | Rails timing was off by a bit or Ruby would have gotten more
       | momentum (at that time there were already many things in Python
       | land to compete like Django etc.). Meanwhile JS was still pretty
       | cludgy to use and required a lot of hoops just to set up an
       | environemnt and things like node came a bit late as well or JS
       | would have taken more "web backend marketshare" from Python
       | immediately. There was a window when the Python 2->3 transition
       | slowed things down (imo) but overall it went slow but smooth for
       | such a big transition.
       | 
       | Python was also an early player in other niches like security
       | (both scripting and tooling).
       | 
       | And when ML happened to take off (grossly simplified) once again
       | Python was there as an early player with good tooling and support
       | for most things and with excellent ties to scientific computing.
       | 
       | It also got good support early from some key players, most
       | noteably Google.
       | 
       | So basically, Python was always there when it mattered and "good
       | enough", came with "batteries included" and the Python community
       | has always been great + willing to quickly get working tooling
       | and libraries in all relevant areas. Importantly Python has
       | always been beginner friendly enough to attract a decent chunk of
       | non programmer specialists from other fields that used it to dive
       | into programming (scientific computing in general but biology
       | comes to mind as a typical use case).
        
       | reddit_clone wrote:
       | One reason:
       | 
       | Perl community spent most/all of its capital on the Perl6
       | debacle.
       | 
       | People waited for years (decades?) for Perl6 to come out. Most
       | moved on (to Python). Perl6 turned out to be a totally different
       | language when it did come out.
       | 
       | Mind you, I love Raku and use it daily but its development did
       | cost Perl mindshare and marketshare.
        
         | mempko wrote:
         | Raku 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?
        
       | carapace wrote:
       | JS 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.)
        
       | badrabbit wrote:
       | The ecosystem created an echo-system.
       | 
       | Being default on linux helped python succeed, not anything
       | specific about the language. It became default on Linux because
       | it was better than perl or bash (easier to use and manage deps)
       | and had decent upstream support and an ecosystem around since the
       | 90s.
       | 
       | On windows powershell is still king, python shares the throne as
       | a close second though. Compare all that import-module, nuget,
       | winget, chocolatey,etc... mess with pip! And version nightmares
       | are more manageable thanks to pyenv. Python ecosystem is good at
       | making a mess work well (except when it doesn't).
        
       | moonchrome wrote:
       | Ruby was never similar in popularity to Python. It was just a fad
       | in webdev circles. I've rarely seen ruby before RoR and I've seen
       | python all over.
       | 
       | Python was popular as a teaching language, how it gained a
       | foothold in academia.
       | 
       | I remember 20 years ago when I was starting out it was popular
       | for game scripting (Lua was more embeddable but python was also
       | used). plenty of first class interfacing methods to native code
       | (still remember c++ boost shipping python binding generator).
       | 
       | Many tools shipped python as an embedded scripting language.
       | 
       | Python was used for creating build systems.
       | 
       | Not to mention any distro out there ships python, it replaced
       | perl in that regard. Batteries included and being available
       | helped it become the norm for random scripting.
       | 
       | Python was big before numpy/ML.
        
         | CTmystery wrote:
         | I'll bite on "just a fad in webdev circles", in case you are
         | serious and not trolling. Railsworld is celebrating the 20th
         | anniversary of Rails this year. As I'm sure you know, Rails is
         | built on Ruby. 20 years does not fit my definition of fad.
        
           | kstrauser wrote:
           | I see what you mean, but I counter with Plone. It's been
           | around for 24 years, and the annual Plone Conference is
           | coming up in a couple months. Still, you don't see a whole
           | lot of new Plone sites rolling out these days, and there's no
           | Automattic-scale company with click-here-to-deploy
           | convenience.
           | 
           | Nothing against Plone (although I was very happy to put its
           | foundation layer, Zope, in my rear view mirror). It's a fine
           | program that's very good at what it does. But just because
           | something's been around a while doesn't mean that it's still
           | vibrant and growing.
        
           | tetha wrote:
           | Mh. Honestly, I've encountered ruby in about 3 primary ways.
           | RoR and Sinatra, which are kinda the same webdev thing, and
           | Chef as a config management. There are additional things, but
           | more supporting things - Rake and Capistrano as deployment
           | systems, Berkshelf and such as supporting things.
           | 
           | Outside of this, it's been perl and python, with python
           | replacing perl after that whole perl 6 fiasco while the
           | language and distros started understanding packaging python.
        
           | moonchrome wrote:
           | My point was more that Ruby exploded because of a period when
           | Rails was growing super fast. I don't know what the growth in
           | RoR space is but I'm certain it's nowhere near what it was in
           | late 2000s/early 2010s. And outside of that there's really
           | not much in Ruby space.
           | 
           | Python was all over the place when RoR came out, meanwhile I
           | only remember hearing about Ruby on random forum posts or by
           | some enthusiast before RoR.
        
           | Cthulhu_ wrote:
           | 10 ish years ago, pretty much all new hip HN startups plus
           | existing success stories all started in Ruby on Rails, or
           | feels like they did anyway.
        
           | adamrezich wrote:
           | I don't think moonchrome was disparaging Rails or minimizing
           | its popularity, but, rather pointing out that Ruby is only as
           | popular as it is because of webdev, because of Rails (and the
           | Rails-likes that came after)--outside of that specific niche,
           | it's not very commonly used just about anywhere else,
           | especially when compared to Python.
        
             | Lutger wrote:
             | Chef and puppet are fairly big ones though. Other than
             | config management, I think this is true. Rails is king in
             | ruby land.
        
           | JAlexoid wrote:
           | Just because there are people who still use it, doesn't make
           | the statement that RoR was a fad less true. RoR was "the
           | thing that everyone was using" at one point. It was that for
           | several years. Anyone who's anyone was building stuff with
           | Rails.
           | 
           | Now it's probably the third option, when building websites...
           | and a fourth option, when building APIs.
        
           | ysavir wrote:
           | I think they meant back before either Ruby or Python hit
           | their stride, not afterwards.
        
         | KaiserPro wrote:
         | I first bumped into python because mailman was written in it.
         | It was a large, slow and a bit funny. I saw it as another odd
         | academic language that had spilled out of a university
         | somewhere.
         | 
         | Then in about 2005 I heard about zope, and how easy and
         | wonderful it was compared to php. But it was slow and memory
         | heavy.
         | 
         | In about 2008 more and more stuff started getting python
         | bindings, specifically in VFX (where I was working). There was
         | a tussle between javascript and python, and python won out,
         | even displacing MEL and other domain specific languages.
         | 
         | Ruby was always more obscure to me, it was for people that
         | likes C and wanted a more perl-y version of it, but without the
         | anachy or the universality of CPAN.
         | 
         | I think the biggest reason was that it had loads of stuff in
         | the standard lib, way more than anything else at the time. Much
         | more than perl, so it meant that things were a bit more
         | "portable". So people came for the stdlib, then started adding
         | things to it because they'd spent all that time learning it.
        
         | EdwardDiego wrote:
         | When I first looked into Ruby, pre-RoR, but only just, the
         | stdlib docs (in English) were a gaping void compared to the
         | Python docs. Would have been around early Python 2 days, 2.3 I
         | think.
        
         | WhyCause wrote:
         | > Many tools shipped python as an embedded scripting language.
         | 
         | I had dabbled with Python before encountering it (in its
         | embedded form), but once I started using it inside ESRI's
         | ArcGIS software, it became my go to language for many, many
         | tasks.
        
         | cutler wrote:
         | You're forgetting the period of Ruby's popularity in the devops
         | world, especially Chef and Puppet.
        
           | local_person wrote:
           | [dead]
        
           | moonchrome wrote:
           | I think that's just building on RoR hype in that same field.
           | Puppet even moved away from Ruby AFAIK.
        
           | rcarmo wrote:
           | Puppet 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...)
        
       | EamonnMR wrote:
       | Rails was really good at building a very specific type of website
       | and that kept Ruby popular for a while, but SPAs resulted in back
       | end web apps that mostly just shuffled json around, something you
       | don't need Rails for (though rails does a fine job of it) with
       | it's page-oriented world; that responsibility got delegated to
       | React.
       | 
       | Meanwhile, python ended up being the default programming language
       | taught to domain experts in a ton of different domains. Having
       | your engineers write the same programming language as your domain
       | experts turns out to be really useful for business. Using NodeJS
       | as your backend if you consider web your domain is also an
       | excellent choice and also eats into Rails' market share.
       | 
       | I have seen some shops with modern rails deployments do truly
       | awesome stuff, but it's hard to beat being able to take a script
       | an analyst has written, hit it with a linter, and throw it into
       | your production application.
       | 
       | Also, for what it's worth, the python 2/3 debacle was a much
       | bigger deal back in the height of Rails' popularity. I was
       | genuinely worried that the schism would continue to haunt the
       | community; that someone would fork 2.x and we'd have two
       | competing pythons. That didn't happen thankfully.
        
       | atoav wrote:
       | As 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 wrote:
       | long time ago (2007??), GvR asked in the maillist, "what topic to
       | talk about in next coming PyCon"
       | 
       | what i posted/suggested then was something in the lines "how to
       | make Python not to be next Java, i.e. turn into carreer-
       | language". of course nobody noticed.
       | 
       | Well, seems python did become next java. kind-a. i cannot decide
       | is it good or bad.
        
       | [deleted]
        
       | seydor wrote:
       | I m still not convinced it won. If google dies tomorrow, how long
       | would it survive
        
       | cutler wrote:
       | Whilst the design of Ruby is far superior, Python has a wider
       | range of data structures which may explain why it managed to gain
       | a foothold in the scientific world. Both are multi-paradigm
       | languages but procedural Python is also a little more idiomatic
       | than its equivalent in Ruby which maybe makes Python easier for
       | scientists who don't want to go all-in learning a more elegant
       | language. Pretty soon in Python's rise it became all about
       | libraries. Ruby never took the scientific world that seriously
       | until it was too late.
        
         | SalmoShalazar wrote:
         | What about the design of Ruby makes it far superior?
        
       | tobinfricke wrote:
       | When I first encountered Python, it was as an alternative to
       | Perl.
       | 
       | Given the choice between Perl and Python, I think it's clear why
       | the latter won out.
        
         | worik wrote:
         | > 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
        
           | TheCleric wrote:
           | Some people (me included) LOVED the whitespace-as-a-feature.
           | I had swam through too many scripts where everything
           | (regardless of nesting level) was all on the first character
           | of a line or otherwise spaced randomly where my first step
           | was to properly indent just to understand what it was doing.
           | A language that enforced that was a Godsend.
        
           | JAlexoid wrote:
           | Perl 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 wrote:
             | a million different ways, but all with liberal use of
             | human-unfriendly symbols like dollar signs, at signs, pound
             | signs, etc.
        
           | NegativeK wrote:
           | I 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.
        
             | ipaddr wrote:
             | Whitespace strictness is the biggest downside of python.
        
             | tetha wrote:
             | I 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.
        
           | SalmoShalazar wrote:
           | A bizarre opinion to be sure. Python is vastly more readable
           | then Perl and is far easier to write as well, hence so many
           | educators in schools reaching for it.
        
           | TulliusCicero wrote:
           | Perl is a write-only language, whereas Python almost reads
           | like pseudocode. They're on absolutely opposite ends of the
           | readability spectrum.
        
       | version_five wrote:
       | I'll just add that python provides a pretty good transition for
       | matlab people doing scientific programming, it keeps all the
       | simplicity for scripting, had a good range of packages, etc,
       | another person brought this up too.
       | 
       | For the generation who used matlab in grad school and then
       | abandoned engineering and science to become software engineers,
       | it provided a good soft landing to transfer skills.
        
       | __mharrison__ wrote:
       | In a word... numpy.
        
       | daft_pink wrote:
       | My anecdotal experience:
       | 
       | I found it really easy to adopt and use as a non-programmer. I
       | ran out of rows in my excel spreadsheet, and needed something
       | that would ingest my spreadsheet quickly. It took me one line of
       | code to import, and then one line to export.
       | 
       | I was quickly off to the races with deep data analysis and felt
       | it worked so much better than excel as the calculations were more
       | readable and reproducible.
       | 
       | I learned Ruby for Ruby on Rails before this, but it just isn't
       | as quick and easy.
        
       | jokoon wrote:
       | Python borrows a lot from C for its syntax and flavor and
       | imperative style, it's not exactly like C, but it "feels" a bit
       | like C (it's hard to explain why).
       | 
       | Python has a lot of native things like list dict sort join etc,
       | you need library much less often your code gets very very short.
       | 
       | Python has some functional programming in it, which makes it even
       | more flexible than C++ in my view.
       | 
       | Python is just so readable with its indentation style, very few
       | language do it like this. I even started to make a C-ish language
       | with indent-style scoping, it's a bit difficult but I did it.
       | 
       | Even if it's one of the slowest language out there, it's so good
       | and simple that you realize that what matters is not the language
       | speed, but what matters is what you write. A good and fast
       | software must be well designed first, the language choice comes
       | second.
       | 
       | Python is VERY OFTEN the best choice because its simplicity lets
       | you write better software more easily, so in my view, a language
       | like python allows programmers to write better software.
       | 
       | Programming language philosophy matters.
        
       | karmasimida wrote:
       | It wins because it focuses on what people can do with it, not
       | indulging itself with some cosmetics level syntax feature.
        
       | mcemilg wrote:
       | I think it's just by a chance, Ruby could win too if the data
       | people first gather around it.
        
       | 3np wrote:
       | One 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.
        
       | nurettin wrote:
       | Python bundled Tk. Academia loved it. Imagine being able to
       | script knobs and dials into your doctorate thesis in a few lines
       | 20 years ago without knowing Delphi.
       | 
       | They loved it so much that they made homework-solving numerical
       | libraries. They turned into numpy.
       | 
       | At some point, almost every undergraduate and most of finance
       | industry was churning python. Python 3 was released. People hated
       | that. Microsoft was interested. Guido started following modern
       | languages. Asyncio was buggy. Pandas was built. Django was
       | jealous of Rails. Not much happened for a while. AI! CNNs! Deep
       | neural networks! Alpha go beat everyone. Tensorflow! Suddenly
       | everyone did pip install. Cuda, pytorch. Ruby got left behind.
       | Asyncio got fixed.
        
       | monroewalker wrote:
       | I often hear this kind of praise for Ruby but have never really
       | dug into it myself. Does anyone have any links to pages that do a
       | good job of covering some of the main selling points of Ruby in
       | terms of syntax, features, ecosystem, etc.?
        
         | arp242 wrote:
         | This is probably a decent enough intro to get a general "feel":
         | https://learnxinyminutes.com/docs/ruby/
        
       | runjake wrote:
       | Coming from Perl, I love Ruby (for non-Rails stuff), but end up
       | using Python because:
       | 
       | - The documentation in the Python ecosystem is generally better.
       | 
       | - There's more Python libraries, and they're generally better
       | maintained and better documented.
       | 
       | - Python has a better interface to C.
       | 
       | - Python is more popular and generally more supported by third
       | parties.
       | 
       | - Django/Flask
       | 
       | - There is comparatively little Ruby activity outside of Rails
       | and a few cybersecurity projects.
       | 
       | I really do not like Python. I think it's really inelegant. But
       | it's a better tool for getting my tasks done, due to the above
       | reasons.
        
       | mkl95 wrote:
       | Python beat Ruby because it's boring technology, whereas Ruby
       | prides itself on being as clever as possible. Take a large
       | application written with Django vs the equivalent Rails app. Even
       | if the Django app was written by mediocre engineers and their
       | Rubyist counterparts were very smart, it's probably much easier
       | to spot the footguns in the Django app. The cognitive load of the
       | average Rails monolith is almost unbearable to non Rails experts.
        
       | avip wrote:
       | python does many things well
       | 
       | ruby does one thing very well
       | 
       | So apparently the "do one thing well" thingy doesn't always hold
        
         | zem wrote:
         | ruby 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.
        
         | JAlexoid wrote:
         | That 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.
        
       | natch wrote:
       | This 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.
        
       | kazinator wrote:
       | > _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
       | 
       | 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 wrote:
         | Wikipedia suggests that Python debuted in 1991, with Ruby
         | following in 1995.
        
           | kazinator wrote:
           | I 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.
        
       | ActorNightly wrote:
       | Languages that won, win, and will win are all of those that are
       | moving towards being smart, in the sense that the
       | compilers/transpilers infer what the programmer is trying to do
       | and generate the appropriate code under the hood.
       | 
       | The future of programming is describing the majority of programs
       | in something thats even closer to English, and then fine tuning
       | it with something like python, all of which will result in
       | natively compiled optimal binary.
        
         | AlotOfReading wrote:
         | People 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 wrote:
           | You 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 wrote:
             | The 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.
        
         | Koshkin wrote:
         | It never seemed to me that "ADD 1 TO COBOL GIVING COBOL." was a
         | good idea. (FORTRAN, on the other hand, made a lot of sense.)
        
       | dkarl wrote:
       | A lot of people who picked up Python, especially in the 1990s,
       | picked it up as a side language. They were doing "serious"
       | programming in C or C++, and they needed another powerful,
       | potentially cryptic language like they needed a hole in the head.
       | 
       | I believe that Python gained popularity among scientists for the
       | same reason. They needed a simple programming language, not
       | because they lacked brainpower, but because their job was to
       | focus their intelligence on the scientific problems they were
       | solving, not on programming. Writing code was necessary but not
       | meaningful in itself, like washing beakers or feeding lab rats.
       | The less effort it took, the better.
       | 
       | For people like that, Python won because they were able to become
       | productive with it while learning very little about it. Also, it
       | was rare to accidentally write Python code that was hard to read.
       | This was especially important for scientists, who didn't have a
       | software engineer's appreciation of the difficulty of reading
       | code and the need to practice restraint when writing it.
        
       | bjourne wrote:
       | It has very little to do with Python itself. Python won because
       | GvR ran an extremely tight ship. And there were many extremely
       | talented core developers that helped make Python a polished
       | product. The development team made all the right decisions,
       | except for rejecting PEP 355 which was a big mistake. The
       | batteries included approach helped grow the ecosystem. Developers
       | wrote third party libraries in the hopes of them eventually,
       | someday be incorporated into Python's standard library. Python
       | also came in an msi installer and made the Windows experience
       | pleasant, unlike Ruby and Perl which iirc were painful to get up
       | and running.
        
         | vodou wrote:
         | > 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.
        
         | PartiallyTyped wrote:
         | > PEP 355
         | 
         | Didn't this eventually become what is now pathlib (which I am a
         | big fan of) ?
        
           | SalmoShalazar wrote:
           | pathlib is truly excellent! The overlap with the os library
           | is unfortunate, but I can't complain.
        
         | stevesimmons wrote:
         | > 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.
        
       | dyeje wrote:
       | You're comparing apples and oranges here. My sense of the market
       | is there are a roughly similar amount of companies using Django
       | and Rails to create web applications (maybe actually a slight
       | edge to Rails).
       | 
       | The majority of Python usage is in data, ML, etc which is really
       | an entirely different use case and discipline.
        
       | tracker1 wrote:
       | I always thought of Ruby as Perl++ more than anything. It's
       | relatively easy to write, not always so easy to look at and
       | refactor later. As to why Python has won, I think you nailed it,
       | the library integrations and academic space has made it popular
       | and useful there.
       | 
       | Ruby's popularity for what it was, was heavily tied to Rails. As
       | that space progressed, a lot of people came to dislike it as much
       | as anything, and maybe more. There are a lot of ways it didn't
       | work so great and those warts made more and more avoid it in
       | future projects.
       | 
       | That's my $.02. I started with JS as well, but in '96 and through
       | classic ASP (JScript and VBScript) through VB6, .Net (and C#)
       | then into/through Node.js etc. I also dabbled in PHP, Ruby and a
       | handful of other tech along the way. Python feels like a massive
       | gap in my knowledge base at times, I have a few books to read,
       | but not much in terms of opportunity/need. And the time I've
       | spent on Python, I feel like I'd rather spend that time leveling
       | up in Rust.
        
       | at_a_remove wrote:
       | I 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.
        
       | pirate787 wrote:
       | Python didn't win. PHP adapted and remains the language that
       | powers the Internet.
        
       | coldtea wrote:
       | Because Ruby was tied to Rails, whereas Python had both a Rails
       | competitor, not as popular but decent enough to be used by
       | several big companies (Instagram, Pinterest, Spotify, Disqus,
       | Bitbucket, and others), plus libraries for science, and later for
       | the rising field of machine learning and even AI.
       | 
       | That said, Python was always more popular than Ruby to begin with
       | (more jobs, more programmers, more college CS classes, more
       | books), even in 2000-2010. Ruby was liked, but was only hot
       | because of the Rails connection.
        
       | ifyoubuildit wrote:
       | My primary exposure to python is when it is failing in some way,
       | often when I wouldn't have even known python would be involved
       | (like trying to install something with npm or apt).
       | 
       | I'm sure this is less of an issue when you work with it every day
       | and are familiar with it, but I always dread seeing python in the
       | requirements for something because it means the odds of it "just
       | working" on a random system are probably not great. Anybody else
       | have this experience?
        
         | jquast wrote:
         | Yes, 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.
        
       | AdamH12113 wrote:
       | The way I (somewhat hazily) remember it, Python was mainly
       | competing with Perl as a scripting language, not Ruby as an
       | application/web language. I started hearing about Ruby years
       | later when Ruby on Rails drove the Web 2.0 movement, but that
       | feels like a different era to me. Eric S. Raymond wrote an
       | article[1] in 2000 about his experience trying Python after
       | spending a lot of time with Perl. I'll quote some of it here:
       | 
       | > When you're writing working code nearly as fast as you can type
       | and your misstep rate is near zero, it generally means you've
       | achieved mastery of the language. But that didn't make sense,
       | because it was still day one and I was regularly pausing to look
       | up new language and library features!
       | 
       | > This was my first clue that, in Python, I was actually dealing
       | with an exceptionally good design. Most languages have so much
       | friction and awkwardness built into their design that you learn
       | most of their feature set long before your misstep rate drops
       | anywhere near zero. Python was the first general-purpose language
       | I'd ever used that reversed this process.
       | 
       | [1] https://www.linuxjournal.com/article/3882
        
         | tootie wrote:
         | I think it's kinda nonsense. No programming language is
         | intuitive. It's arcane by nature. Having slightly more concise
         | syntax saves you maybe a week of learning time. I used to write
         | Perl about as fast as I could think because I had a lot of
         | practice with it. I mostly do Python now, but do a lot less
         | coding in general and I have to google syntax constantly.
         | Python is less noisy, but it's not really more intuitive for
         | me.
         | 
         | Frankly I think language design is secondary to IDE
         | integration. The only time I've ever coded without thinking at
         | all was using Java with IntelliJ or C# with Visual Studio.
         | Type-matching and library introspection all work flawlessly 99%
         | of the time. Not only do I not need to know the details of
         | syntax, but I didn't even need to know APIs because I could
         | autocomplete everything all the time. Python with VS Code still
         | feels stone age by comparison.
        
         | dale_glass wrote:
         | I think a good part of the issue is that right around then,
         | Perl decided to do Perl 6.
         | 
         | People decided to wait on doing anything big, since Perl 6
         | wouldn't be quite compatible. Later it turned out to be
         | extremely incompatible. And Perl 5 would be dead long term, so
         | why spend time on it, when you'd have to do a radical rewrite
         | soon?
         | 
         | Meanwhile, Python was there.
         | 
         | And Perl 6/Raku took 15 years to finally arrive in some form,
         | by which point Python had completely eaten its lunch.
        
           | AdamJacobMuller wrote:
           | Perl 5 to Perl 6 transition took so long that python had it's
           | own internal crisis with Python2 -> Python3 transition inside
           | of that (and handled it far better).
        
         | sgt wrote:
         | Good memories. I still have that issue in the attic somewhere.
        
         | MatthiasPortzel wrote:
         | This comment was very helpful.
         | 
         | Part of my question is why Python was used as a successor to
         | Perl and not Ruby, but it sounds like Python was established as
         | a competitive scripting language 5 years before people were
         | talking about Ruby.
         | 
         | I can't find it now, but there was another comment that pointed
         | out that the languages weren't contemporaries.
        
       | bandrami wrote:
       | The competition in the early oughts was Perl (and PHP, but
       | sticking with general purpose languages). Python was widely seen
       | as "better" in some abstract sense while Perl was what everybody
       | used for their day job.
        
       | drbig wrote:
       | So instead of the original long-winded pour-down: Python is good
       | enough and easy enough. And it made it a thing for people
       | interested in solving stuff with software - as opposed to people
       | making software to do stuff - and that is a crucial if subtle
       | distinction.
       | 
       | I don't like Python but I'm getting paid almost a decade working
       | with it everyday and... it is good enough.
        
       | TylerE wrote:
       | Well, for one thing, the versions of ruby were sloow, like an
       | order of magnitude slower than python at the time. It didn't even
       | have a JIT - it was pure interpretation - if you went through a
       | loop 10 times, the code inside got parsed 10 times.
       | 
       | Also, python predated ruby by several years. Python 1.5.2, which
       | is about the earliest version that resembles modern Python, was
       | release in early 1998. The first Dnglish language book on Ruby
       | didn't come out until late 2000.
        
       | ilikenwf wrote:
       | I really wish schools would teach compiled languages before
       | scripting languages.
        
         | bdcravens wrote:
         | What's the current CS101 standard? I know when I was in college
         | in the late 1990s, it went from Pascal to C++ to Java.
        
           | [deleted]
        
           | ilikenwf wrote:
           | In 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...
        
         | masklinn wrote:
         | Great news, python is compiled, you got your wish.
        
           | ilikenwf wrote:
           | Unless 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 wrote:
             | Maybe 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.
        
       | Buttons840 wrote:
       | Can I quote zach's 15 year old comment on Python vs Ruby? Maybe
       | it will have some relevant insights:
       | 
       | > Ruby has clever syntax. Python has pure syntax.
       | 
       | > Ruby has method aliases. Python does not allow a string to
       | capitalize itself.
       | 
       | > Ruby uses Ruby methods within Ruby classes to extend Ruby.
       | Python has decorators so you can write functions that return
       | functions that return functions to create a new function.
       | 
       | > Ruby has strict object-oriented encapsulation. Python is laid-
       | back about objects, because you probably know what's going on
       | inside them anyway.
       | 
       | > Ruby lets you leave off parentheses so you don't miss objects
       | having attributes too much. Python will let you mix tabs and
       | spaces for indentation, but passive-aggressively mess up your
       | scoping as punishment.
       | 
       | > Ruby has seven kinds of closures. Python has one, in the
       | unlikely case a list comprehension won't do.
       | 
       | > Ruby's C implementation is a mess of support for language-level
       | flexibility. Python's C implementation is so clean you get the
       | unsettling thought that you could probably write Python using C
       | macros.
       | 
       | > Ruby supports metaprogramming for cases when programmers find
       | it more descriptive. Python supports metaprogramming for cases
       | when programmers find it necessary.
       | 
       | > Ruby is expressive. Python is direct.
       | 
       | > Ruby is English. Python is Esperanto.
       | 
       | > Ruby is verse. Python is prose.
       | 
       | > Ruby is beautiful. Python is useful.
       | 
       | > I like Python, but coming to it after using Ruby for seven
       | years, well, I think it's like dog people and cat people. You can
       | like having one species around, but you're always thinking -- why
       | they can't be more like the other?
       | 
       | -- This is one of my favorite HN comments of all time:
       | https://news.ycombinator.com/item?id=682364
        
       | moandcompany wrote:
       | Like SQL, it's terrible in many ways, but in many more ways it's
       | good-enough, commonly known enough, and/or accessible to others.
        
       | scoofy wrote:
       | I come from an analytic philosophy background. I studied
       | mathematical logic and set theory in grad school as part of my
       | logic requirements. I never learned to program for a long time,
       | and it was always a source of embarrassment. A friend finally
       | suggested that I learn Python because it was "English-like" as
       | you say, so I bought _Learn Python the Hard Way_.
       | 
       | When I opened the book, unlike java or js, I could just read the
       | code. Like... I could just read it and already understood what
       | was happening. I already knew _way, way_ more logic than would
       | ever need. I think it took me about a day to figure out object-
       | orientation, but it was trivial. I went from not knowing how to
       | program, to being able to run fizz buzz in like a day, and do it
       | with objects in like three. Other languages are so caught up in
       | so much bullshit technical stuff I still can 't stand them.
       | 
       | Python is intuitive. It's approachable. I focuses on getting you
       | from zero-to-code over a bunch of much more technical
       | applications. Python is the party that welcomes you in, instead
       | of checking your ticket at the door.
       | 
       | As a non-CS person who has fallen in love with programming, I
       | honestly never want to learn another language if I don't have to.
        
       | v64 wrote:
       | Many comments have commented on the ecosystem, but I've thought a
       | big reason behind python's success is that it's also a well
       | designed language in terms of readability and lack of surprise.
       | My background was in perl and shell scripting before finding
       | python and the absolute beautiful form of the language (that
       | whitespace is significant in more ways than one!) and its utter
       | insistence that There's One And Only One Obvious Way To Do It
       | (more or less) made programming much more ergonomic compared to
       | the other similar scripting languages at the time.
        
         | The_Colonel wrote:
         | > 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.
        
       | m0llusk wrote:
       | Readability. The most important thing for code is to be
       | comprehensible by developers. Python has several factors
       | contributing to readability. White space as syntax is the most
       | obvious thing. More than that, unlike Perl which has more than
       | one way to do things Python tends to have one or maybe two
       | canonical ways of accomplishing common tasks. This makes it
       | easier to navigate code without having much experience. Python
       | was also good at interfacing with existing libraries from the
       | start so a lot of work got scripted quickly in Python using high
       | powered C libraries. Arguably being able to work with popular C
       | interfaces was yet another factor contributing to generally high
       | readability of code.
        
         | alpaca128 wrote:
         | I 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.
        
       | Buttons840 wrote:
       | What concepts does a language _force_ a new user to be aware of,
       | and how reliable are user 's first intuitions about those
       | concepts?
       | 
       | I would argue that Python dominates Ruby in this metric.
       | 
       | New users wonder how to call functions. They form an intuition
       | ("use parenthesis"), but it's unreliable. "Oh, parenthesis are
       | optional--oh, parenthesis are only optional sometimes".
       | 
       | New users wonder what a function _is_ exactly. They form an
       | intuition, but their initial intuition doesn 't encompass all 7
       | different types of callables in Ruby, so many surprises 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.
        
         | preordained wrote:
         | I'd argue that better relative ergonomics had diddly squat
         | effect on Python's current position. It's first mover
         | advantage, plain and simple. It got its hooks in data science
         | like JavaScript got its in the browser.
         | 
         | I can say that personally using Ruby, Python felt like a
         | massive step backward. I can see how others might disagree, but
         | I feel like it's all in what you know first. On a certain
         | level, most of us know JavaScript is just terrible, but there
         | have been millions of new devs who knew nothing else and
         | thought it's fine--better than fine, its great, it's the
         | _other_ stuff that 's weird! But then you go on for a while,
         | maybe eventually find lisp and/or functional programming, and
         | you realize how brain-damaged our most commonly used tools
         | really are.
        
           | dekervin wrote:
           | _I 'd argue that better relative ergonomics had diddly squat
           | effect on Python's current position._
           | 
           | And you'd be wrong.
           | 
           | I can confidently say that since I fully expecteded python to
           | win over ruby and it did. Every time I used to hear hipsters
           | dev being all the rage about ruby, I knew they implicitly
           | discounted the cognitive load that goes with learning ruby.
           | 
           | The path from pseudo code to working python code was ( is? )
           | straight forward and ruby doesn't bring anything in term of
           | paradigm over python that justifies foregoing that advantage.
           | 
           | So everytime a bright mind wanted to implement a library in
           | her field of expertise, python was her tool of choice. And
           | that's how python conquered field after field.
        
           | wpietri wrote:
           | > I'd argue that better relative ergonomics had diddly squat
           | effect on Python's current position.
           | 
           | I'd agree with that. I've done a lot of work in Python and
           | Ruby. I mostly do Python these days. I think Ruby's
           | ergonomics were better, especially for novices. (E.g., if you
           | want to know what methods you can call on an object, in Ruby
           | you can just look at the object, but in Python there are a
           | whole zoo of global functions you're supposed to know about.
           | [1]) But I think ergonomics just don't matter much when
           | compared with more practical considerations like availability
           | of libraries or number of developers available to hire.
           | 
           | [1] https://docs.python.org/3/library/functions.html
        
           | Buttons840 wrote:
           | Can you explain more about how (you feel) Python is a step
           | backwards? I'm curious if the "steps backward" are syntax
           | level?
           | 
           | I feel the Ruby community is very syntax oriented. As
           | evidence of this:
           | 
           | I see Ruby developers interested in Elixir and Crystal,
           | languages that are syntactically similar, but technically
           | very different.
           | 
           | I do _not_ see Ruby developers interested in Python, even
           | though, if we ignore syntax, Python and Ruby mine as well be
           | the same language. Technically speaking, and in the grand
           | scope of all languages, Ruby and Python are very very
           | similar.
        
         | oezi wrote:
         | It is sad to me that you hate Ruby. It is a better language
         | than Python for my taste in all dimensions except number of
         | libraries available.
         | 
         | To begin with I could never understand why there need to be
         | those global functions in Python to do meaningful things with
         | lists.
         | 
         | In Ruby the "everything is an object" really works down to
         | every nut and bolt and is clean and very conceptually pleasing.
         | 
         | Whether you call a package a gem, module, jar or whatever isn't
         | very central.
        
         | mellavora wrote:
         | >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?
        
           | Buttons840 wrote:
           | Double underscores are ugly, but not surprising or
           | frustrating. I say they are not frustrating because the
           | language doesn't force beginners to be aware of how they work
           | right away. Double-underscore methods are there for people to
           | seek out when they're ready, but the language and the
           | surrounding community doesn't push people into comprehending
           | them. Intuition is good enough for a long time. Ruby has more
           | focus on metaprogramming which is likely to force users into
           | some pretty complicated stuff before they're ready.
           | 
           | print as a statement is inconsistent and surprising, but the
           | explanation is shallow--they made an exception for print,
           | that's all there is to it. It's not beautiful but it is
           | unlikely to cause a 2 hour debugging session.
        
             | oezi wrote:
             | A lot of Rubyists are turned off by Python because there
             | are just too many ugly things and exceptions in Python.
        
               | Buttons840 wrote:
               | 100% fair. They're probably right; certainly right from
               | their own subjective view, which is what matters.
               | 
               | I'll also note that the OP focused on how "fun" Ruby was.
               | Ruby is beautiful and fun.
               | 
               | Going back to the original question: why did Python grow
               | more than Ruby? My first answer was going to be a
               | rhetorical question: which beautiful and fun language has
               | been the most successful?
               | 
               | C isn't especially beautiful or fun, not in the same way.
               | (It has a nice minimalism and connection to the hardware
               | maybe.) C++ is beautiful--is a thing that nobody has ever
               | said. Java ain't beautiful. JavaScript, Python, etc, none
               | are especially beautiful or fun.
               | 
               | I think another answer to the OPs question is that
               | beautiful and fun languages are, apparently, not what
               | most people are looking for. Evidently we should not
               | expect a language to succeed because it is beautiful and
               | / or fun.
        
           | ptx wrote:
           | > _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.
        
       | ravenstine wrote:
       | - 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.
        
       | reducesuffering wrote:
       | Python is the scriptiest lang that is mostly understandable from
       | other popular C-based langs like C++, Java, JavaScript.
       | 
       | Ruby is too different; too many symbols and idiosyncrasies
       | inherited from Perl, Smalltalk, and created by itself.
       | 
       | That is the root reason why they diverged and Python ended up
       | with the scientific ecosystem.
       | 
       | This is further evidenced by Ruby's popularity only shooting up
       | with Rails, when 2005 web 2.0 attracted lots of non-CS people to
       | come into the field with no prior C-based experience, so they
       | learned Ruby, html, and css fresh.
        
         | rcarmo wrote:
         | Lua is actually a much better embeddable language, but it's not
         | as popular and has its quirks.
        
       | vmchale wrote:
       | Python manages to have decent performance because NumPy uses an
       | APL-like model and it happens to skirt the design flaws (dynamic
       | typing, interpreted). J for instance has a tree-walking
       | interpreter written in C that performs well!
       | 
       | Ruby's poor performance hobbles it even in places it's supposed
       | to be good (twitter was rewritten to Scala over rails).
        
         | cutler wrote:
         | Ruby 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.
        
       | znt wrote:
       | I think it just survived naturally, filling in the cracks left by
       | Java / C++.
       | 
       | And now the era of Textual (https://textual.textualize.io/) is
       | here, python may get the spotlight even more.
        
         | vopi wrote:
         | Can 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!
        
       | r_thambapillai wrote:
       | Python ended up 'specializing' in data contexts, thanks to Numpy
       | / Pandas, and as a result, ended up becoming the first exposure
       | to programming than anyone doing data stuff had. That was
       | millions of people. In that space, it had no competitors.
       | 
       | Ruby ended up 'specializing' in web dev, because of Rails. But
       | when Node and React came out, Ruby on Rails had to compete with
       | Nodejs + React / MERN as a way of building a web app. Since
       | people first learning programming to build a web app would
       | usually start with javascript anyway (since a lot of very first
       | projects might not even need a backend), it was a lot easier for
       | the Nodejs/React route to become the default path. Whereas if you
       | were a data scientist, you started on python, and as you got
       | better, you basically just kept using python.
        
         | paulddraper wrote:
         | > In that space, it had no competitors.
         | 
         | Well, there's R.
         | 
         | But basically, yes that's the long and short of it.
        
           | jacurtis wrote:
           | Or Julia, a language custom designed for data science.
           | 
           | Also, MatLab was the go-to before Python took over the scene.
           | So it definetely has competitors.
           | 
           | Python's strength is that it is the "jack of all trades"
           | language. Its not the best at anything but its pretty good at
           | everything.
        
         | kevinlu1248 wrote:
         | Might be wrong but I think it started with Jupyter/MatplotLib +
         | Python's permissive license. Heard it started all with a
         | physics professor unable to use Matlab for teaching.
        
         | forrestthewoods wrote:
         | Good answer.
         | 
         | Python is, imho, not a very good language. But it has a few
         | great libraries which led to overwhelming momentum and inertia.
         | In a cruel twist of irony those libraries are probably written
         | in C.
        
         | twelvechairs wrote:
         | I agree with these as major points. A few other secondary ones
         | 
         | Ruby was primarily maintained in Japanese, so had a barrier to
         | entry for language level issues. It also lacked english-
         | language evangelists and university presence.
         | 
         | When Ruby was new (invented 1995) Python had some older design
         | issues (as it was 6 years older) however it really recovered
         | and implemented a lot of change through Python 2 (2000) and
         | python 3 (2008). Though there were compatability issues in the
         | short term in the long term this change worked out.
         | 
         | Ruby inherited from perl TIMTOWTDI (there is more than one way
         | to do it) philosophy which is a little more at odds with the
         | scientific community
        
         | dmazzoni wrote:
         | I think Python was popular as a general-purpose language first.
         | After all, there was a reason people put so much effort into
         | writing Numpy in the first place.
         | 
         | I think a lot of people were attracted to the language design,
         | as captured in the Zen of Python
         | (https://peps.python.org/pep-0020/), such as:
         | 
         | Explicit is better than implicit.
         | 
         | Readability counts.
         | 
         | Errors should never pass silently (unless explicitly silenced)
         | 
         | There should be one-- and preferably only one --obvious way to
         | do it.
         | 
         | In many cases, Ruby has almost the opposite philosophy. There's
         | nothing wrong with that - but I think a lot of people prefer
         | Python's choices.
        
           | CTmystery wrote:
           | Only one of the items in your "such as" list is unique to
           | python's philosophy, and that is "there should be one way to
           | do it". Ruby embraces the many ways to accomplish something,
           | it's true. However, the three others are not unique to
           | python. Ruby especially embraces "readability counts". And I
           | can't think of anything in the ruby language itself that is
           | implicit over explicit. Perhaps you are thinking of rails and
           | comparing that to python.
        
             | pcthrowaway wrote:
             | > And I can't think of anything in the ruby language itself
             | that is implicit over explicit
             | 
             | This is surprising to me. I love ruby, but it embraces
             | implicitness more than any other language I've used.
             | method_missing, monkey patching internals, and other types
             | of metaprogramming make things _very_ implicit at the
             | interface level
        
             | ysavir wrote:
             | Ruby has implicit return values for methods, but unless I'm
             | wrong, so does Python.
        
               | dragonwriter wrote:
               | Python has a default None return, Ruby returns the value
               | of the last expression.
               | 
               | Neither (except maybe the None case in Python) is really
               | implicit, Ruby is just an expression oriented language
               | while Python is statement-oriented.
               | 
               | OTOH, in Ruby the _keyword_ "return" is superfluous
               | except for altering control flow for an _early_ return,
               | while in Python it is the mechanism for supplying a
               | return value.
        
               | kstrauser wrote:
               | Python's only implicit return value is the default
               | `None`.
        
             | kstrauser wrote:
             | For me, the Ruby community's comfort with monkey patching
             | was a big turn off. In Python, you _can_ hack around on
             | class and replace its methods, but if you do, it 's
             | expected that your coworkers might stick you in a dunk tank
             | and sell tickets. It's just not the thing that's done.
        
               | nextos wrote:
               | Monkeypatching is maybe more of a Rails thing than Ruby.
               | I think the biggest problems with Ruby around the time
               | Python began to take off were slowness (MRI was a
               | disaster, slow, and full of memory leaks), plus patchy
               | documentation (lots of things were in Japanese).
               | 
               | Still, I preferred and prefer Ruby. Python has fantastic
               | libraries, but it is a mediocre language. Ruby feels like
               | a simpler version of Perl + Smalltalk, and it is a joy to
               | use. Python has intentionally crippled anonymous
               | functions plus syntactic whitespace, which often leads to
               | long and ugly code.
               | 
               | I think it is a shame Guido hated functional programming
               | and he did not embrace an Algol-like syntax with begin/do
               | end blocks. Those two things could have vastly improved
               | Python. Ruby's block, procedure and lambda design is a
               | stroke of genius that yields beautiful code and makes
               | DSLs trivial.
        
               | EdwardDiego wrote:
               | I figure if Django built an entire framework around
               | metaprogramming, I'm going to do it to Django model
               | objects as a form of vengeance.
        
               | kstrauser wrote:
               | I want to see the malicious wonders you can create!
        
               | EdwardDiego wrote:
               | An easy way to start taking the fight back to the enemy
               | is by overriding __new__ and tinkering with things
               | before/after Django's metaclass __new__ does its own
               | metafoolery.
               | 
               | Also overriding mro() is a fun way to monkey with the
               | inner workings.
        
           | tshaddox wrote:
           | > I think Python was popular as a general-purpose language
           | first.
           | 
           | That matches my memory as well. I can't find any references,
           | but I seem to remember a quote going around way back circa
           | 2008 that goes something like "Ruby is popular because it's
           | the language used to write Rails; Django is popular because
           | it's written in Python."
        
           | dragonwriter wrote:
           | > I think Python was popular as a general-purpose language
           | first
           | 
           | What I understand is that Python was popular in the
           | anglosphere as a general purpose language first, Ruby was
           | somewhat popular in Japan earlier as a general purpose
           | language but didn't become popular in the anglosphere until
           | Rails, and even after becoming popular through Rails.
        
             | felipetrz wrote:
             | I was actually surprised when I found out they made a web
             | framework in "the RPG Maker XP language".
        
           | [deleted]
        
           | KerrAvon wrote:
           | No, that's self-important bullshit. These are just evidence
           | that Python really suffers from people in that community not
           | using any other languages.
        
           | skeletal88 wrote:
           | There are just too many ways to do things in Ruby. How many
           | forms for an if-else or for loopin can you name in Ruby? Just
           | as the simplest example.
           | 
           | Monkeypatching is also awful for readability.
           | 
           | Explicit imports are way more readable than things appearing
           | into current namespace implicit kind of stuff like it happens
           | with Ruby
        
           | treis wrote:
           | I think this is it. Love Ruby as a language. Have grown to
           | hate the way Ruby developers write stuff. Stuff ends up with
           | so much abstraction and indirection. End up yearning for a
           | simpler time when you could write code that just did what you
           | needed it to.
        
           | dylan604 wrote:
           | >I think Python was popular as a general-purpose language
           | first.
           | 
           | What were their choices though, Perl? It's easy to see why
           | Perl lost out. Other than PHP, I don't really know of any
           | other JIT scripting languages they could have chosen.
        
             | Izkata wrote:
             | You arbitrarily restricted the scope. Java is what I saw.
             | 
             | I was in college 2006 - 2010 in CS, and while all the
             | introductory courses were in Java, by 2008 or so a lot of
             | the other students had switched to Python on their own, for
             | projects where either language would work. Didn't really
             | see anything else, just Java and Python.
        
               | dylan604 wrote:
               | No, it wasn't arbitrary. A JIT language is much easier to
               | pick up than something needing a compiler and an
               | executable. The focus on a scripting language was
               | deliberate
               | 
               | Edit: turns out the term I'm looking for wasn't JIT but
               | an interpreted language.
        
             | andrewprock wrote:
             | The other strong contender at the time was Tcl, especially
             | when combined with the graphical library as tcl/tk. Python
             | implemented tk as well given it's popularity.
             | 
             | Tcl's extensibility led to expect, which was very useful
             | for automating scripting over telnet.
             | 
             | https://en.wikipedia.org/wiki/Expect
        
             | BeetleB wrote:
             | There were always other choices. Lua is the main one that
             | comes to mind.
             | 
             | The point is that data science use came quite late in the
             | Python world, and the increase in users due to it is
             | incremental. Python was already at 3.x before the ML world
             | adopted it. If the ML world picked another language, Python
             | would still be in the top 5 languages.
        
             | rubinelli wrote:
             | Perl's actually excellent at processing unstructured data,
             | and it had a strong foothold in bioinformatics for a time.
             | I don't think the decision was as obvious as it looks.
        
             | adastra22 wrote:
             | Python may be JIT now (is it?), but it certainly wasn't
             | back then.
        
               | dylan604 wrote:
               | JIT may not be the correct thing to call it. At least in
               | my head, any script that doesn't need to be compiled by
               | the dev or the user before running is JIT. It's the
               | scripting vs building difference to me. If that's not
               | correct, then I'd love to be corrected.
               | 
               | Here's my reference:
               | 
               | https://en.wikipedia.org/wiki/Just-in-time_compilation
        
               | floxy wrote:
               | Interpreter vs. Compiler might be closer to the
               | distinction you are looking for:
               | 
               | https://en.wikipedia.org/wiki/Interpreter_(computing)
        
               | dylan604 wrote:
               | Thanks. "My interpreter doesn't care about white spaces,
               | why should I" being something that should have clued me
               | in.
        
             | dmarchand90 wrote:
             | Perl and python have opposite philosophies with regards to
             | standards. Python prefers a standard "pythonic" way, while
             | perl had its "there is more than one way to do it".
             | 
             | It would seem that having a standard is more popular.
        
               | dylan604 wrote:
               | Yeah, there's the ongoing Perl joke about writing a
               | script that works today, but not understanding how it
               | works tomorrow. Too much one-liner type stuff that did
               | not allow for maintainability
        
               | SoftTalker wrote:
               | That's any code I haven't looked at for a while, to be
               | honest. I can't count how many times I've looked at code
               | I wrote or bug tickets I fixed and have absolutely no
               | memory of doing it. It's almost like the act of
               | committing flushes the local storage in my brain.
        
               | dylan604 wrote:
               | Perl is different as people really tried to do this on
               | purpose with maximizing the concept of one liners. Maybe
               | it's a PTSD kind of an effect? "Any" code or good code
               | doesn't try to be developed in a way that is difficult to
               | parse by the next person. Perl developers definitely
               | didn't adhere to the policy of writing code like the
               | person maintaining it is a serial killer that picks
               | people that write unmaintainable code and they know where
               | you live.
        
             | floxy wrote:
             | Icon? Smalltalk? Dylan? Scheme? Common Lisp?
        
             | Gualdrapo wrote:
             | I knew about Python in 2006 or so when got into Linux, and
             | at that time (when Python 2 was a thing, iirc it just came
             | out) it was very popular between the FOSS world for doing
             | apps and GUIs (I even toyed a lot with PyGTK), whereas I
             | felt Perl was much more about more "serious" stuff like
             | text processing and kind of a sh language with steroids. I
             | just barely heard about Ruby and wasn't sure what it was
             | its purpose - I just heard about its "gems" but not about
             | Rails. Still as both Python and Perl were FOSS I supposed
             | their niche and user base were going to be around it, as
             | many things FOSS at the time.
             | 
             | At 2008 I started my graphic design studies and I just
             | pretty had to forgot about programming (which in hindsight
             | if I had kept doing it I would have a very strong
             | programming background and maybe my life would be much
             | better now, but it is what it is) - but was very surprised
             | to discover around 2011 or so that it seemed _everyone_ was
             | using Python. Like I just blinked and it took over the
             | world somehow.
        
           | Loeffelmann wrote:
           | > There should be one-- and preferably only one --obvious way
           | to do it.
           | 
           | This is so hilariously wrong in python though
        
             | jacurtis wrote:
             | That was the one mantra from the zen of python that I
             | always laugh at too.
             | 
             | Because my #1 complaint with python is that there are so
             | many ways to do the same thing. It sounds nice in theory if
             | you are a new developer because you can create your own
             | voice in python and character.
             | 
             | For example, lets say I gave a simple coding puzzle (think
             | leetcode) to 10 python engineers. I would get at least 8
             | different responses. A few might gravitate around similar
             | concepts but they would be significantly different.
             | 
             | By comparison if I gave the same puzzle to some Go
             | engineers, all of the responses would be probably very
             | close to identical.
             | 
             | This sounds fun as a new engineer, like this is an argument
             | for using Python. But as you get older and more experienced
             | you will likely find yourself hating the flexibility of
             | python because as you scan any decent size codebases, you
             | start to be able to identify entire parts of the codebase
             | and who wrote them, without even needing to do a git blame.
             | 
             | I am currently an SRE manager who works in a very polyglot
             | environment (primarily Node/js, bash/sh, python, and Golang
             | with just enough java thrown in to ruin your day). When I
             | read through python codebases, I can identify exactly who
             | wrote it, even past employees. Then when you need to fix
             | it, you often have to adapt to that style as you fix a bug
             | or add an updated feature. This is a little true with Bash
             | because you will see certain engineers always lean towards
             | sed and others towards awk and grep to solve problems
             | depending on their strength, but it is less significant.
             | However, in our Go codebases, everyone writes nearly
             | identical code.
             | 
             | I've been writing Python for over a decade and I still
             | learn new features of the language every week or month.
             | Just this week I had to dive into the `ast` library
             | (abstract syntax trees) which was a native module I haven't
             | ever touched before. By contrast, I haven't had to learn
             | any new core syntax and tools of Go and Bash in a long
             | time. You have a fairly small set of syntax and that's it.
             | The power comes in how you use that small set of tools, not
             | learning a new language module.
             | 
             | Again, the infinite flexibility sounds nice. But in a
             | corporate environment the strictness of other languages is
             | actually a benefit because it keeps everyone following the
             | same path.
             | 
             | I truly believe the mantra from zen of python:
             | 
             | > There should be one-- and preferably only one --obvious
             | way to do it
             | 
             | Sadly, Python lost this tradition far before I ever became
             | acquainted with the language. And the python3.10+ mentality
             | of supporting everything forever is only going to make it
             | worse overtime.
        
             | dragonwriter wrote:
             | IMO, its not "hilariously wrong" in Python.
             | 
             | Note that as written the priority is that every use case
             | has _at least_ one _obvious_ approach, and that a secondary
             | priority is that there should be a unique _obvious_
             | approach.
             | 
             | People often seem, however, to misread it as "there should
             | be only one possible way to perform any given task." Which,
             | yes, is hilariously false for Python, but also not what it
             | says.
        
             | felipetrz wrote:
             | There is always one obvious way to do things in Python, but
             | it happens that what's obvious varies from person to
             | person.
        
             | bsder wrote:
             | You're young enough to have never dealt with write-only
             | Perl code ...
             | 
             | Be glad.
        
             | EdwardDiego wrote:
             | Whatever in the NamedTuples do you mean?
        
             | kemayo wrote:
             | There's generally one _obvious_ way to do it. There 's
             | almost certainly other ways to do it, and those other ways
             | might be better suited for different specific tasks, but
             | the obvious way tends to exist and be widely usable.
             | 
             | Are there some exceptions? Sure.
        
               | rout39574 wrote:
               | I'd suggest "pythonic", rather than obvious, for that
               | sentence. It's one of the ways the community reminds
               | itself of the utility of consistent discipline.
        
               | kemayo wrote:
               | It's perhaps worth noting that the next line of the Zen
               | of Python is: "Although that way may not be obvious at
               | first unless you're Dutch." (I.e. unless you're Guido.)
               | 
               | So it was a bit of a tongue in cheek statement from the
               | very beginning. :D
        
             | rout39574 wrote:
             | So I imagine you have that perspective because you started
             | less than 20 years ago. In some ways the idea of the
             | Pythonic Way to do things evolved in opposition to Perl's
             | vigorous advocacy of More Than One Way.
             | 
             | Python has been really winning for some time, so it's
             | natural that its ideological discipline has grown ragged.
             | The crop of kids who value options above consistency don't
             | have the scars of the Perl age to inform their prejudices.
             | 
             | But Python is -dramatically- better focused, as a
             | community, on finding a Pythonic way to proceed, and then
             | advocating it, than previous cultures.
        
               | kbenson wrote:
               | > But Python is -dramatically- better focused, as a
               | community, on finding a Pythonic way to proceed, and then
               | advocating it, than previous cultures.
               | 
               | I would revise that to be that to be that the pythonic
               | culture of one acceptable way to to is better matched
               | with a lot of good development practices.
               | 
               | Perl was also very good at finding a Perl way to proceed.
               | It's just that with Perl that often mean a lot of
               | implicitness and "do what I mean", and multiple ways to
               | do it so you could fit it within your preferred style and
               | tailor it to the current project's needs.
               | 
               | That all sounds good until you are confronted with the
               | flip side of the coin, which is that it's harder to
               | understand when looking at something written with those
               | perspectives for the first time or after a long hiatus
               | from the project, which puts a lot of importance on
               | policy and standards which saps effort from just getting
               | something done.
               | 
               | I love Perl, and it's still the language I write most
               | often for work, and it's no great mystery why Python
               | became preferred.
        
               | gabereiser wrote:
               | Not just practices, tooling. The whole typing system.
               | Linting to check for mistakes. For the love of black.
        
               | cutler wrote:
               | But Ruby took all the best bits of Perl so I'm still
               | perplexed as to why Python "won".
        
             | thesuperbigfrog wrote:
             | As evidenced by the unified Python library / dependency
             | management system.
        
               | shpx wrote:
               | I use pip 100% of the time
        
               | thesuperbigfrog wrote:
               | >> I use pip 100% of the time
               | 
               | What about pipenv, poetry, conda, setuptools, hatch,
               | micropipenv, PDM, pip-tools, ActiveState platform,
               | homebrew, or your Linux / BSD distro's package manager?
        
               | bsder wrote:
               | As much as I love to rag on things, I would go so far as
               | to say that _the_ big problem with Python packaging is
               | the fact that it tries to manage C /C++ packaging and
               | integration.
               | 
               | If Python is only managing Python code, the issues to be
               | solved are _VASTLY_ simpler. Just about anything works.
               | 
               | Once it has to deal with dynamic libraries, compiled
               | code, plugins, build systems, etc. the combinatorial
               | explosion just makes life suck.
        
             | chaxor wrote:
             | Far _faaaar_ better with respect to this than R though at
             | least.
        
             | nwallin wrote:
             | Yeah. It is now.
             | 
             | It didn't used to be though. People would wax poetically
             | about how pythonic some codebase was and sing the praises
             | of idiomatic python. There was an ideological war between
             | Python ("there should be one--and preferably only one--
             | obvious way to do it") and Perl. ("there's more than one
             | way to do it" or TIMTOWTDI, pronounced "Tim Toady")
             | 
             | Generators and comprehensions and decorators and
             | `functools` are all relatively new.
        
             | imiric wrote:
             | I like Python, but most of the Zen has always been a meme,
             | and not a guideline of design principles of either the
             | language, or software written with it.
             | 
             | Besides the one you mention, I also find the "Explicit is
             | better than implicit" line to be against everything Python
             | stands for. The language is chock full of implicit
             | behavior, and strongly encourages writing implicit code.
             | From the dynamically typed nature of the language itself,
             | to being able to define dunder methods that change the
             | behavior of comparison and arithmetic operators.
             | 
             | I really like Go partly because of this. Not only does the
             | language itself stictly follow the explicit over implicit
             | and TOOWTDI principles, but it encourages or even enforces
             | them on the programmer.
        
           | wslh wrote:
           | I remember entering in Python because you have slices and
           | other syntax sugar stuff that makenyou think other
           | programming languages were making you life miserable on
           | purpose!
           | 
           | Also, the batteries included in the standard libs was
           | incredible when you needed to use the ACE/TAO monster in C++.
           | 
           | Finally, interfacing with native code via SWIG enables you to
           | quickly use critical optimized code.
           | 
           | Obviously, other programming languages captured Python power
           | since then.
        
         | gabereiser wrote:
         | Bingo! Then you have 2-3 year experience junior devs join your
         | company because they know react and are completely blank stare
         | faced when you ask them how they are serving their data.
        
         | fiddlerwoaroof wrote:
         | As a Python programmer in the 2.x days, I think data science
         | happened fortuitously to counteract the exodus over the 2->3
         | transition. For a long time, it felt to me like python was on
         | the way out because of the changes.
        
         | thewataccount wrote:
         | I'll argue that python is very alive in the system
         | management/scripting space.
         | 
         | Because of the library support (especially for data) it's also
         | popular as api servers. It's not as popular for entire
         | applications but is still very active.
         | 
         | EDIT: Django is actually about equal or more popular then
         | nodejs based on google trends. Not sure that means anything as
         | idk how many people google "nodejs" when working on it.
        
         | seydor wrote:
         | That was Matlab. Python was the substitute
        
         | rcarmo wrote:
         | There is a lot more history before the data part. But yes, it
         | is a big "modern" driver for its popularity, and Python owes it
         | to its easy C interop.
         | 
         | I would contest the Ruby as web dev part, though. I used Ruby
         | for Puppet and Vagrant a long time ago and it was great, but
         | all my experiences with Rails (and associated gems) turned into
         | maintenance nightmares.
        
         | eddy_chan wrote:
         | Today I learnt I'm fucking old. My first web programming
         | exposure was Perl CGI scripts
        
           | latchkey wrote:
           | #metoo, 1993.
        
           | kstrauser wrote:
           | This fine day, we are all old together.
        
         | mattferderer wrote:
         | I think that data science & web competition is at least 80% but
         | I'm going to throw out a few possible ideas that I haven't seen
         | mentioned that may have helped. Maybe I'm way off base though.
         | 
         | * Udacity's popularity. It's first few free courses were
         | Python. I believe they advertised as a way to get into Google.
         | Not sure how many people got into Google via Udacity though.
         | 
         | * Leet Code Job Interviews. Maybe I'm way off here as I don't
         | do these but from what I've read people who spend a lot of time
         | on these prefer Python because the syntax & libraries often
         | give a speed & simplicity advantage.
         | 
         | * Lots of devs had to install Python to use some utility or
         | tool someone else created.
        
         | dgellow wrote:
         | To add to your comment, the web space was also already very
         | crowded, with PHP, C#/ASP, whatever Java people were using,
         | Django, etc. Rails has always been fairly niche compared to
         | giants like PHP.
        
           | rcarmo wrote:
           | People like to hate on PHP (and to be honest I really never
           | enjoyed it), but there was a time when if you wanted to build
           | powerful, large scale websites (or hosting, or scalable web
           | farm deployments) it was the most reliable and performant
           | thing short of Java.
           | 
           | It also helped that the PHP ecosystem had some pretty solid
           | and battle tested HTTP components and pretty productive
           | frameworks--server-side rendering with Varnish was as fast as
           | a CDN-backed site feels today.
        
             | CuriouslyC wrote:
             | The things PHP had that made it win (for a while) was that
             | it was easy to set up and configure for a hosting
             | environment (Apache plus modphp worked out of the box
             | consistently) and the HTML first design made it easy to add
             | to static web pages, whereas forms and CGI was multiple
             | steps and more confusing for less experienced devs.
        
         | masklinn wrote:
         | > Python ended up 'specializing' in data contexts, thanks to
         | Numpy / Pandas
         | 
         | Yeah it was a success 20 years in the making, had a fair amount
         | of input from science men and that being GvR's background he
         | responded positively e.g. the extended slices (striding) and
         | ability to index with an unparenthesised tuple
         | (multidimensional indexing) were very much added for the
         | convenience of numpy's ancestors.
         | 
         | I would not say it had no competition, Perl used to be quite
         | popular in at least some sci-comp fields (I want to say
         | bioinformatics but I'm probably wrong).
        
           | cutler wrote:
           | Why probably wrong? Bioperl was very big in the
           | bioinformatics world.
        
             | masklinn wrote:
             | > Why probably wrong?
             | 
             | Because I don't have a great memory and I was never into
             | Perl so I was extremely unsure of the suggestion and didn't
             | want it to come across as an assertion.
        
         | inasio wrote:
         | Maybe it all came down to the decision to fuse python's Numeric
         | and Numarray libraries into Numpy, providing a unified "fast"
         | Matlab-like library, which ended up being a great fit to a lot
         | of datascience use cases.
        
         | qsort wrote:
         | Numpy is certainly amazing, but there are tons of competitors
         | in the data/scientific space, which pure "A-type" data
         | scientists tend to prefer: R, SSPS, Matlab...
         | 
         | The difference is that Python doesn't entirely suck as a
         | general-purpose language. Sure, you might have better options,
         | but it's still reasonable to write almost anything in Python.
         | 
         | Other scripting languages like Ruby, JS and Lua are probably a
         | little bit better when evaluated strictly on their merits as
         | programming languages, but they lack the ecosystem.
         | 
         | In other words, it might be inelegant, slow, a mess, whatever,
         | but the concept behind it is _basically correct_.
        
           | local_person wrote:
           | [dead]
        
           | CuriouslyC wrote:
           | Some industries are stuck on matlab (jet propulsion, for
           | example) but in general people from sciences are either
           | Python or R, and SAS/SPSS are only really used in places like
           | health care or pharma where there's a lot of regulation in
           | place, because the software is designed around that
           | regulation, unlike Python and R.
        
           | dekhn wrote:
           | numpy exists (somewhat indirectly) because matlab cost $$$.
           | and now numpy is a far larger use of matlab's concepts than
           | matlab will ever be.
           | 
           | I haven't seen anything an "A-type" data scientist needs in
           | R/SAS/SPSS that was intrinsic to the language and couldn't be
           | ported to Python. I don't want a "data/scientific" language,
           | or a "web" language, or a "UI" language- I want one language
           | that explicitly supports all the usecases well-enough.
        
             | qsort wrote:
             | > I haven't seen anything an "A-type" data scientist needs
             | in R/SAS/SPSS that was intrinsic to the language
             | 
             | Not intrinsic to the language but in terms of the
             | ecosystem, for a purely A-type data science workload R is
             | significantly better. dplyr + ggplot vs. pandas +
             | matplotlib isn't even remotely close.
             | 
             | Now, obviously in the real world nothing is ever purely
             | model work, which is why Python more than makes up for the
             | difference.
             | 
             | > I don't want a "data/scientific" language, or a "web"
             | language, or a "UI" language- I want one language that
             | explicitly supports all the usecases well-enough.
             | 
             | Me neither. *taps sign*
             | 
             | >> The difference is that Python doesn't entirely suck as a
             | general-purpose language.
        
               | CuriouslyC wrote:
               | R is great when your data is already together in one
               | place and homogenous/processed. In that instance the
               | workflow using dplyr/ggplot is better. R the language is
               | hot garbage though, and the libraries available for doing
               | random things that aren't working with certain data
               | structures, doing math or plotting are generally much
               | worse than their python equivalents. That is the reason
               | python dominates data engineering, and why it's pushing R
               | out everywhere but academia.
        
               | dekhn wrote:
               | R will still have a solid place in industrial pharma for
               | a long time (even as python growths, R growth will
               | continue. R is pretty tightly intertwined with the
               | process of processing and submitting data from clinical
               | trials to the FDA, much to SAS's chagrin.
               | 
               | Personally I think we have to accept that R, Python,
               | Java, C++, and Go are going to be with us for the rest of
               | our lives. I would expect PHP, Ruby, and Perl to go away
               | much faster. Rust is still in question.
        
               | dekhn wrote:
               | If there is anything in R that is better, it could be
               | ported. It's kind of different from language intrinsics
               | that can't be easily ported. In fact I think there's a
               | great argument for writing a standardized data processing
               | and visual representation layer in C++, and then making
               | it usable from all the languages. It would be nice if
               | this was true for the notebook layer.
        
             | fluidcruft wrote:
             | Matlab has a more interesting dispatch model than python
             | though. (Mathematica has even better dispatch but I haven't
             | used it in almost 20 years at this point) Julia's model is
             | even better, but I just never have time to dig into it
             | deeply enough to get to the zen of Julia. One day when I
             | have time to understand Julia I'd like to, but it's hard to
             | compete with the reliability of python just always working.
        
               | dekhn wrote:
               | What is dispatch in this context? Function call
               | polymorphism?
               | 
               | Aside: I wasn't a big fan of the Mathematica language so
               | I wrote "PyML" a looooong time ago- it turned unevaluated
               | Python expressions into Mathematica, transmitted them via
               | MathLink to be evaluated the Mathematica kernel, and then
               | the results were send back and converted to a Python
               | expression. This was long before sympy. It never went
               | anywhere (I found ways to simply not depend on
               | Mathematica).
        
           | TuringNYC wrote:
           | >> R, SSPS, Matlab...
           | 
           | I'd immediately throw out "competitors" that cost hundreds of
           | dollars to use. https://www.mathworks.com/pricing-
           | licensing.html Academic pricing is $275/yr and normal is
           | almost a thousand a year. Then you pay for modules on top.
        
             | ImaCake wrote:
             | Yes, and this is why R has become so dominant in the data
             | and statistics spaces. R is free, and has gained so much
             | momentum that it often has packages that no other language
             | has. Yesterday I found out that there was just no way to
             | easily reproduce mgcv::gam in python. There are loads of
             | similar examples.
             | 
             | As someone who likes both R and Python, and had the
             | misfortune to learn Stata; I am very glad to see R winning
             | over these expensive dinosaurs. Maybe one day it will even
             | displace matlab!
        
           | karmasimida wrote:
           | Anyone who used Matlab to process text before 2015 wouldn't
           | consider it anywhere closer as a competitor to Python
           | 
           | Same goes for R/SASS
           | 
           | Python has no competitor in terms of the whole package, it is
           | a full featured language while being particularly good at
           | data
        
           | deadmutex wrote:
           | Matlab costs $$. Matlab was ahead in perf for a long time,
           | not sure now. E.g. they used to JIT code, etc.
           | 
           | Comparing python to R, python feels like a much more mature
           | language. R always seemed only useful for small scale
           | projects, e.g. writing some script to process data with < 20
           | lines of code. Python codebases just scale much better.
        
             | kstrauser wrote:
             | It also has the nice feature of being good at multiple
             | things. If you get a model running in Python, and decide
             | you want to be able to run the code via an API, put it
             | behind Flask and ta-da!, now it's a network service.
             | 
             | It's not the _best_ way to write analysis code, and it 's
             | not the _best_ way to write a web service, but it 's
             | probably the best way to write analysis code that runs on a
             | web service.
             | 
             | I picked web services as a random example, not one I'm
             | particularly passionate about. But as a general trend, if
             | you want to combine 2 unrelated domains, Python probably
             | has you covered better or more easily than just about any
             | other language.
        
       | jdlyga wrote:
       | Back in 2010, most devs were using Java or C++. As any C++ dev
       | will tell you, setting up 3rd party dependencies takes forever
       | especially on Windows. In comes Python with its simple yet
       | powerful core language features, batteries included philosophy,
       | and tons of easy to install packages. That attracted a lot of
       | attention from C++ and Java devs looking to get things done
       | easier. It also attracted attention from systems developers
       | looking for a saner alternative to writing Bash scripts. Not only
       | that, but because of the simplicity of development, it became a
       | core teaching language for learning programming. And because of
       | all of that, it became even more popular when more math-oriented
       | people needed a language to use for AI/ML.
       | 
       | Ruby fits a lot of the same niches. I also remember experimenting
       | with Ruby at the same time I was experimenting with Python. But
       | it's an either/or situation, like HD-DVD and Blu-Ray. Ruby fell
       | into obscurity almost _because_ of the rise of Python. Because we
       | now have a solid ultra-high level language with batteries
       | included, there 's less of a need to also focus on Ruby.
        
       | latenightcoding wrote:
       | Good marketing: it's not even a simple language but people
       | marketed it as executable pseudo-code and it worked.
       | 
       | Also Perl dropped the ball with Perl 6.
        
       | stillsut wrote:
       | Going meta: I haven't read a HN thread in years that I agreed
       | more with for almost every single comment. Incredible niche
       | breakdown of the mess of factors that drove happenstance to
       | circumstance. No ideology, just learned on the ground experience.
       | More of this?
        
       | umutisik wrote:
       | I don't see this mentioned often: One thing that interpreted
       | languages like Python have over compiled languages is that all
       | libraries have to be open-source by default (unless they are
       | wrappers). It makes it a lot easier to debug and put in minor
       | fixes on the fly.
        
       | amelius wrote:
       | The ecosystem and critical mass.
        
       | [deleted]
        
       | aidenn0 wrote:
       | I first encountered Python around 2000. At the time Perl was more
       | popular in the circles I frequented, and TCL probably about as
       | popular as Python (eggdrop[1] notwitstanding), but Python was
       | growing steadily. I encountered Ruby in the late '00s (as others
       | have noted it made its english-language debut almost a decade
       | after Python started) and Lua was another contender during this
       | time.
       | 
       | My memory is that, at least outside of the web/RoR world, Ruby at
       | no point as popular in the US as Python. Lets take, say 2005 as a
       | point that Ruby was really gaining popularity due to Rails: at
       | this point I was already seeing internal tools that previously
       | would have been written in Perl being written in Python.
       | 
       | Python just seems to have maintained a certain momentum, and I'm
       | not sure why, but if I had to guess:
       | 
       | 1. The syntax is almost a dead-ringer for pseudo code. The first
       | time I encountered Python, I fixed a bug in an open-source
       | project having never seen Python before. I recall two different
       | CS programs switched to Python from Scheme for exactly this
       | reason.
       | 
       | 2. It was designed to glue C together. Other languages were too
       | (TCL and Lua; Perl primarily interfaced with the outside world in
       | the same way shell does, with pipes).
       | 
       | 3. A kitchen-sink approach to the standard library helped it a
       | lot for the first 20 years of its existence. CPAN was sui-generis
       | at the time for installing libraries, so the more you could do
       | without relying on 3rd-party libraries, better off you were.
       | 
       | 1: https://en.wikipedia.org/wiki/Eggdrop
        
         | nuancebydefault wrote:
         | Before Python got popular, Perl was the most similar popular
         | language. Once I encountered Python, I felt, this is Perl, but
         | done right.
        
           | rcarmo wrote:
           | Excellent point. I moved from Perl 4/5 (writing fairly
           | involved RADIUS code) to Python (doing other stuff, but still
           | intricate) and the fact that I could actually read my code
           | six months later made all the difference.
        
           | kstrauser wrote:
           | That was my experience. I like Perl. I'm comfortable with
           | Perl. And after about a day of Python, I never wrote another
           | line of new Perl code.
           | 
           | There were so many "it can't possibly be that easy, but it
           | is!" moments.
           | 
           | Let's write a function to add five to a number:
           | def add_five(num):           return num + 5
           | 
           | OK. So, can I pass that function as an argument to another
           | function?                 def call(func, value):
           | return func(value)            call(add_five, 10)       => 15
           | 
           | What? That worked?! And there was zero additional syntax, you
           | just... do it?
           | 
           | After a seemingly endless list of happy discoveries like
           | that, I seriously rethought my idea of what programming
           | languages could be, and ought to be.
        
             | DoingIsLearning wrote:
             | > you just... do it?
             | 
             | A few years from now, when researchers look at mental
             | workload when writing/reading software, we will have the
             | data to prove that Guido was a Neuroergonomics savant.
        
             | KerrAvon wrote:
             | That sounds trivial? I mean, you can do that in C, what's
             | surprising about it?
             | 
             | I have never found Python as nice to use as you seem to
             | have, but Ruby always fit like a glove. I've written Python
             | since 1999 and I still would rather use almost anything
             | else. It's so labored to do anything complex. You can build
             | worlds in Ruby in the time it takes you to align
             | indentation properly for a single class in Python.
        
               | kstrauser wrote:
               | > That sounds trivial? I mean, you can do that in C,
               | what's surprising about it?
               | 
               | Here's the C version of it:                 #include
               | <stdio.h>              int addFive(int num) {
               | return num + 5;       }              int
               | call(int(*func)(int), int value) {           return
               | func(value);       }              int main() {
               | printf("%d\n", call(addFive, 10));           return 0;
               | }
               | 
               | It's still manageable, but not nearly so simple.
               | 
               | Even Perl doesn't let you escape having to consider
               | pointers and references:                 sub addFive {
               | return shift() + 5;       }              sub call {
               | my($func, $value) = @_;           return $func->($value);
               | }              print(call(\&addFive, 10));
               | 
               | Why do I have to remember to write `'&addFive` in Perl,
               | when Python doesn't require it? Why do I have to write
               | `$func->($value)` instead of the normal `func($value)` in
               | this case? Why do I have to write `$value` in the first
               | place? That's rhetorical: I know the answers. Still, this
               | was the kind of thing that instantly won me over from
               | Perl to Python. It's not that I could somehow write
               | things in Python that were unwriteable in Perl (or C, or
               | assembler, or ...), but that Python let me concentrate on
               | what I was trying to say instead of how to say it.
               | 
               | In fairness, the equivalent Python code with optional
               | typing is also more verbose than my original, minus the
               | pointer stuff:                 from collections.abc
               | import Callable              def add_five(num: int) ->
               | int:           return num + 5              def call(func:
               | Callable[[int], int], value: int) -> int:
               | return func(value)              print(call(add_five, 10))
               | 
               | The key word there being "optional". Python lets you add
               | that if you want to, but you don't have to. And note that
               | the underlying syntax is identical if you delete the
               | annotations. If you opt in to using them, you don't have
               | to alter the code you're annotating.
        
           | TuringNYC wrote:
           | +100
           | 
           | I loved Perl, but it had a culture of doing things in N
           | different ways, too many shortcuts, and you ended up with
           | incredibly tiny scripts which were unreadable -- even to the
           | author -- a month later. This wasnt practical for business
           | use in the face of more consistent code from Python
        
         | lordnacho wrote:
         | > The syntax is almost a dead-ringer for pseudo code.
         | 
         | This is the big one. You look at it, and you think you know
         | what it's going to do. The indentation rules also means things
         | look predictable rather than being a mess of brackets.
        
         | peatmoss wrote:
         | I 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.
        
           | Stranger43 wrote:
           | And 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.
        
           | adrianmonk wrote:
           | That would be similar to saying C isn't a real language while
           | ignoring the existence of C++. Perl 4 wasn't OO, but Perl 5
           | enthusiastically embraced OO. The first release of Perl 5 was
           | in 1994, whereas Java 1.0 was 1996.
           | 
           | It did take a while for the wider Perl community to embrace
           | OO, though. There were a lot of Perl programmers who weren't
           | into lofty paradigms. Plenty of Perl programmers weren't
           | fully sold on the idea of breaking your program into
           | functions.
        
           | rcarmo wrote:
           | I (rather to the displeasure of many people) refer to that
           | kind of OOP Python as "Java fanfic"...
        
           | dizhn wrote:
           | The word "enterprise" kind of reminded me of one possible
           | significant reason for python's huge adoption rate after the
           | second part of the 2000s. Google started using it for a lot
           | of things at some point and was advertising a ton of python
           | jobs. That was both a shining endorsement and a possible way
           | into the company.
        
             | kyllo wrote:
             | I actually think Google picked the winner by deciding to
             | use Python, especially for TensorFlow, right at the time
             | when deep learning really started taking off, and also at a
             | time when they were seen as the leader in engineering best
             | practices that other companies wanted to emulate.
        
               | JAlexoid wrote:
               | Google followed the writing on the wall, nothing else.
               | 
               | Google was known as one of the most academic engineering
               | companies, in the 00-ies.
        
           | Ensorceled wrote:
           | In my experience, Perl got a lot of flak for being "write
           | only", I don't really remember anybody complaining it wasn't
           | "object oriented".
           | 
           | Every Perl code base I've seen, or inherited, has been a
           | mess. My favourite was a bunch of utilities all written by
           | the same person who never did anything the same way twice.
           | Each utility was like an entry in an obfuscated 'C' contest.
           | 
           | I used Perl to build my first web application at LONG time
           | ago. That project is included in the list of Perl code bases
           | I've seen that were a mess :-)
        
             | aidenn0 wrote:
             | There was definitely a group of people who thought "object
             | oriented" was the One True Way and any languages that don't
             | support it are "toys." I'm not sure I ever heard their ire
             | directed at Perl specifically, but I recall the sentiment
             | existing.
        
               | Ensorceled wrote:
               | Oh definitely the attitude exists. I just never saw it
               | directed at Perl. Maybe since, in my experience, Perl has
               | mostly be used as a system language and not a application
               | development language.
        
               | reddit_clone wrote:
               | How the pendulum has swung!
               | 
               | Rust doesn't even sport 'Class'
        
       | 38 wrote:
       | Ruby is really, really slow.
       | 
       | Granted most interpreted languages are, but ruby startup time
       | last I checked was at least 30% more than python.
        
       | stcroixx wrote:
       | Python lets people who would not otherwise program write
       | programs. Back in the day the same people used excel with macros.
        
       | airstrike wrote:
       | Serious answer: the Zen of Python. It makes for a far better
       | version of Ruby
        
       | Qem wrote:
       | According to David Beazley, it was lucky to already being around
       | by the time scientific computing folks were in need for dynamic
       | languages as wrappers to help with increasingly complex hardware
       | and projects written in lower level languages, and the only other
       | viable alternatives back then were Perl and tcl. Watch this talk:
       | https://youtu.be/4RSht_aV7AU?si=d3rJvYJPFGcRy6BK
       | 
       | Then it just snowballed since that time.
        
       | xer0x wrote:
       | Good timing, our company is in the midst of migrating from Go and
       | JS over to Python. I'm struggling with this. Yet, most developers
       | feel they will be happier writing Python for our web application.
       | 
       | I don't know why Python has outshined its contemporaries like
       | Perl, PHP, Java and Ruby. It has done a great job, and there is
       | probably much to be admired.
        
         | jeremycarter wrote:
         | Wait you're moving to Python? I hope you have benchmarked it.
        
       | taylodl wrote:
       | Python was developed in the late 80's and first released in 1991
       | - it's been around awhile. One of the things that always made it
       | useful before it became so popular is its great interop with
       | C/C++.
       | 
       | Ultimately that interop led to NumPy and SciPy, which allowed you
       | to use a rather simple language and yet get high performance when
       | doing calculations. That, as they say, was that.
       | 
       | It doesn't hurt that Python is a multi paradigm language - unlike
       | many of the other popular languages today demanding a particular
       | mindset for programming. You want to do structural programming?
       | Fine. Object-oriented? That's fine too. A little bit of
       | functional (lite)? There's some limited capabilities for that
       | too.
       | 
       | Add in 30 years of Java JIT compilation optimizations that's been
       | applied to Python interpreted code, C/C++ interop - Python is a
       | simple, yet powerful language. That's why it's become so popular.
        
         | colinsane wrote:
         | i 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.
        
         | krackers wrote:
         | >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 wrote:
           | PyPy and IronPython
        
       | Waterluvian wrote:
       | I'll take a stab at it:
       | 
       | Python is _good enough_ at everything.
        
       | allanwind wrote:
       | Projects that I haven written in Ruby has bit-rotted faster than
       | anything else (libraries but not Ruby itself). The tiny webapp I
       | wrote to test out Ruby on Rails has broken on every single major
       | upgrade.
        
       ___________________________________________________________________
       (page generated 2023-08-29 23:00 UTC)