15 years ago I would have agreed. Today, Python is a "gateway" to programming that is also the real thing.
It's like one of those old languages designed for beginners to learn coding... and then you can continue to use the same language for your entire professional career as a software engineer, to build just about any production-ready application.
Ruby is a beautiful language, but unless you are going to be working with Rails, it's not a very practical language to build something in. And I don't think telling a beginner "just learn Ruby for now, but once you're actually ready to write your first useful program, you're probably going to have to learn another language" is very motivating.
I'd say both are pretty bad at performance critical tasks or UI stuff where usually you would use neither of those.
And that's just what I can recall of the top of my head as someone whose primary language is not Python.
What? 99% of science has nothing to do with machine learning. Jupyter is used in a million different environments such as pure mathematics or computational chemistry where machine learning is almost completely absent.
> and you can't say with a straight face that python is a meaningful player in the Web application space, beyond its niche
According to the 2023 Stack Overflow Developer Survey[1], Django is more than twice as widely used as Ruby on Rails.
> According to the 2023 Stack Overflow Developer Survey[1], Django is more than twice as widely used as Ruby on Rails.
Even I'd consider SO surveys relevant, it'd still be a niche, just a bigger niche than rails.
For games, none of the big engines are python or ruby based and Micropython is more of a Python dialect to me with some partial compatibility, you can't just pip install what you want.
"Nobody" uses Python for 2D games. "Nobody" uses Ruby either, but there's Dragonruby (write once, deploy to Windows, Mac, Linux, Web Assembly, iOS, Android, Nintendo Switch, XBOX One, and PS4).
There's interop for many other programming languages, including several options for embedding Python code in Ruby (and the reverse). I've come across Ruby embedded more places than I've come across embedded Python (the number of companies I've come across both are in the single digits).
But ultimately it doesn't matter. If you pick jobs based on currently used languages rather than what you want to work on, you're painting yourself into a corner with either language.
However Python is a easy transition. I rarely struggle to do anything with it when I need it. Even Django wasn't to weird to grasp after years of rails.
IMO it's not to relevant which language you choose to learn in the beginning of your career. Whatever is more fun or works better for your interests.
Early on you should aim to get exposure to multiple languages, ideally at least some very different ones.
So I agree with whatever is more fun. Anything that makes you want to stick with learning is great. Then you can, and should, explore.
If you want something that'll be a marketable skill right away, maybe Python will be a shortcut in the short term, but a developer who knows only one language - whichever one - is eventually going to be at a disadvantage.
The most important skill is not any specific language, but learning how to think about software.
'If you want to build a ship, don't drum up people to collect wood or assign them tasks and work. Instead, teach them to long for the endless immensity of the sea.'
This resonates with how I feel about programming languages. Python might be more practical, but does it ignite a passion for coding like Ruby has historically done? I remember dabbling in Python, Perl, and JavaScript (ES5) back in high school, but it wasn't until I rediscovered programming through Ruby that I truly began to enjoy it.Nowadays, I might not default to Ruby for new projects, having moved on to OCaml and Elixir, among others. Yet, there's something about Ruby's community (its charm and gentleness,) that's missing in many others. This nurturing environment is invaluable for beginners. It's noteworthy how members of the Ruby community, like José Valim with Elixir, Yehuda Katz with Ember.js and Rust, and Chris McCord with Phoenix, have carried this spirit of playfulness and a deep care for developer experience into other communities they've joined.
For context: I worked with C, C#, some Python and now mostly work in Go.
There are plenty of things I'd like to be different about Ruby and the tooling, but with Ruby I feel like I'm crafting something that at least has the potential for elegance, whereas looking at Python code is like staring at a brutalist building that spews its innards all over its surface.
(and yes, I realise some people love brutalist buildings, and I can too, sometime, when particularly well done, and that's why I chose that example - it's possible to do amazing and elegant things in any language, even - as ugly as I personally find it - Python)
It's part of modern science/technology culture to indiscriminately hate the most widespread things.
Personally, I find Python simply amazing and delightful to work with. And I consider its syntax, especially semantic indentation which eliminates so much visual noise, to be the best among all languages that ever achieved widespread adoption.
This is evasive. How often did you see people describe Python that way before it became as widespread as it is now?
> And I consider its syntax, especially semantic indentation which eliminates so much visual noise, to be the best among all languages that ever achieved widespread adoption.
And for me it is why Python will never even make my top 10 preferred languages, and is a language I actively avoid when I have a chance, because I find it visually absolutely awful. I'd suspect (yes, it's pure speculation) you'll find about as many people who detest Python over that alone, as who find Python "delightful". Useful, sure, but finding people who describe Python as delightful is a rarity.
But as I said, some people find brutalist architecture to be amazing too, and that's fair enough.
Quite a lot back in the early 2.x era before the Rails hype first kicked in. It really was a breath of fresh air compared to VB, Perl, JS, early Java or PHP of the time. It had a concise elegant clarity and consistency missing in other mainstream languages back then. And it was a relatively unknown underdog.
eg relevant to HN, here is PG talking about Python 20yrs ago: https://paulgraham.com/pypar.html
I've spent the last decade in Ruby shops and not done much Python recently, but I still miss those early Python days. Ruby never gave me the same sense of happiness it gave others and there are still things I prefer about Python. But it is subjective and I couldn't objectively say Python is better than Ruby.
Things are very different now - it is a much larger language with a much longer history to trip over, pulled in multiple directions with conflicting expectations, and the user base has changed from that small passionate dedicated community to being the intro to coding blub language that Java or PHP used to be where the average skill level is much lower.
I think the major reason for cultural change is that there's fewer people learning programming for fun, and more people learning it either because it's mandatory or as a career path. In which case, the humour and culture that comes out of that is naturally going to be different. I think that's affected Python more than Ruby just because Python is more widely used, particularly by these newer developers. As a result, there's been less cultural shift in Ruby than in Python.
So I think in a sense, you've got the cart before the horse. Python has less of the twee humour now because it's more widely used by newer developers, who in turn are no longer treating programming as a hobby and instead as a career. That said, I can imagine if you want to teach the joy of programming as a hobby, Ruby might be a better choice. Although with that said, I feel like a lot of the hobbyist Python community has moved to things like Raspberry Pi and MicroPython, so maybe it's just a case of finding other hobbyists and doing whatever they're doing: the community is more important than the tool!
But most Ruby use is "corporate" as well - its use is dominated by Rails shops. The "joy of programming" aspect of Ruby is partially embedded even in corporate Rails use, but also outside of it. It may well have hampered Ruby growth, but it's also not something I think would disappear if Ruby use increased.
Go, for example, is aimed at people who love making programs.
1. significant whitespace was so hard to grasp. I was a beginner so I just needed to write awful code
2. Ruby was so "pure" from the OOP perspective that I had one thing less to think about: method calls start from object instances, period. Python has "exceptions" to this rule that made me confused (f.e. `len` in Python is a global function, while in Ruby is `array.length`)
3. I found Ruby matching more to English language
Later I found that Ruby has deeply obscure islands (metaprogramming mainly, but also exotic syntax coming from Perl), but I was already sold to the language
You mean something like Shopify, Stripe or Github? So switch to Python instead so you can be constrained by single-line lambdas and a runtime that performs almost exactly the same as Ruby?