I like ruby much more than python for many reasons, but that's one of those articles which present a lot of arguments so dubious and subjective that it almost convinces the reader that it's actually the opposite of what the title says.
The argumentation in the article isn’t very good but the Ruby community was never good at selling itself and used similar arguments to the article for years.
The syntax is more elegant. Well yes, but that’s also subjective. Also, the argument doesn’t help LISP to be more popular either.
The indentation argument is old and in my opinion hypocritical (yaml, sass, haml). Also, not getting code you copy and paste from the net to work because of syntax errors based on indentation is the least of the problems in copy and pasting code from the internet.
Selling the larger and more diverse library ecosystem of Python as an advantage for Ruby rather funny. Ruby has good libraries for the web and enough for *NIX scripting but I do wish we had some more stuff to keep up with Python when it comes to math, scientific computing and ML.
I have more fun writing Ruby and that is one of the main reasons I use it. And I think it is an easy enough programming language for a somewhat experienced programmer to pick up. DSLs, meta programming and some other advanced concepts are easy enough to pick up in Ruby and you can figure out the pros and cons for your self quickly. We still have a tradition of fun and quirky projects being done in Ruby. There is a gem to create your own card games and a video on YouTube about somebody building an agi upscaler, that code is in ruby.
My sales pitch would be: “Come join us, we are fun and a bit weird, just like our language. We are also fun at parties!”
Ruby might be marginally better for toy examples, but goddam I just finished working a job in a Ruby monolith that had ~1M loc and hundreds of developers and it was a nightmare far worse than Python and reading this article made me feel like venting.
Python's "there should be 1 obvious solution to any problem" culture is way better at scale than Ruby's "there should be 5 subtly different solutions to every problem". I hate the distinction between blocks, procs, and lambdas. Ruby's support for both `...` and `..` likewise does more harm than good. That extra period can be easy to miss while scanning code and we all know how much more important readability is than writability. I also don't like the difficulty to distinguish "magic" references from real ones, unlike in Python where all the magic references have double underscores. It once took me a half hour just to figure out why this seemingly normal method called `method_missing` was being invoked when it seemed like it shouldn't (this codebase was so large and classes had so many ancestors / mixins that finding method definitions was generally a problem. I also don't like mixins btw, or inheritance for that matter, but having 1 is better than having both).
I would discourage anybody from learning Ruby for the simple reason that large Ruby codebases are a scourge to our profession. Small Ruby codebases may be fine, and large Python codebases aren't great either, but I much prefer the language that minimizes all the weird gotchas.
I wonder in which language you think 1m locs would be manageable for an actual monolith (and not just a monorepo).
And method_missing is a such fundamental part of the language, that it obvious you skipped basic docs on the language. Besides that, there're not many "magic references". Unlike in python, btw, where "there should be 1 obvious solution to any problem" mantra doesn't hold for a veeery long time.
I started on Perl. This made Python extremely fatiguing each time I tried to pick it up. Ruby was a breath of fresh air (the creator being inspired by Perl). Unfortunately, I got to it after the crazy late nights of hacking around with new things until dawn had passed and now I’m older and less “hungry” to learn. Now I read history books more than tech books, but I’m still ambitious to rekindle the flame that drove relentless pursuit of new tech knowledge and become proficient in the language.
Comments here say the article is a hack job, so I didn’t read it. That said, I don’t think it’s likely that either language is necessarily better for beginners (and I admit that I base that on nothing but my gut). But non-beginners are probably better suited to whichever more closely resembles whatever they’ve been comfortable with in the past.
I started on Perl as well back in a day, and used it long enough to get a list of things I didn't like, though I liked the basic principles. Ruby really is a Perl without unnecessary parts, which are surprisingly many. I remember noticing absense of reference and dereference operators in ruby and sitting dumbfounded for a minute, all that complexity and syntax noise just never needed.
It might not be a popular opinion, but I'm forever grateful for having started with C and C++ as a new learner, simply because you get a deep appreciation for what high-level languages like Ruby and Python are doing for you under the hood. For example, reading the contents of a file into working memory while accounting for possible problems (determining the file size, allocating the right amount of memory, dealing with various failures, cleaning up afterwards, etc.) is a fairly involved job in C, and trivial in Python or Ruby.
Also, with the rise of LLM code generation for jobs like webdev, I get the feeling that lower-level programming skills are going to be increasing valuable for one's programming career.
I would guess that Ruby and Python programmers generally know at least some c, c++ and maybe even objective-c. That was the case where I worked. It is also normal enough to install gems with native extensions, if you can’t read gcc or clang compiler errors you won’t get very far.
A lot of the points are presented from the perspective of a ruby developer looking at python, not something that's relevant to a new learner. Some of the points aren't even relevant to pythonic programming, like getters and setters. I also noticed they didn't show how to declare a class, because it would be a lot simpler.
I am a Ruby programmer that came to Ruby as a Python programmer that had do do work mainly in PHP and JavaScript (no jobs in Python where I lived at the time). I sort of liked JavaScript (I know it so well now that I’m ambivalent about JavaScript) and started to really despise PHP (most of the problems I hated back then are gone now but I can’t go back).
When I searched for a job that wasn’t PHP or Java based I found a Ruby on Rails job and Ruby really did something for me (and with me). I really liked it and was a bit confounded because I’ve looked into it before and it didn’t do anything for me back then.
Since then I’ve returned to Python for some projects and I find that Python made me better at Ruby and Ruby made me better at Python. JavaScript, Ruby and Python are my main goto languages for scripting and web programming and I think Ruby is getting the short end of the three languages. It deserves better and I think more people, especially web developers and people that need a *NIX scripting language should give it a try.
What I don’t really understand is that we (Ruby programmers) still use indentation for block definition as a reason against Python. Especially since yaml, haml and sass are technologies we helped build and popularize and they are all indentation based. I still agree that Python is the less elegant and more importantly the less fun language.
> What I don’t really understand is that we (Ruby programmers) still use indentation for block definition as a reason against Python. Especially since yaml, haml and sass are technologies we helped build and popularize and they are all indentation based.
The article was written by an LLM[1], not a Ruby programmer.
Now I get your point. That would be a good explanation why the arguments are surface level and regurgitated. This is not really something I want to have to look out for.
nobody serious uses indentation as a bad point against Python. Ruby pretty much could work with indentation instead of "end" almost without drawbacks. Maybe irb would be slightly less convenient, and that's it. Whitespace IS significant in ruby too, it's just goes so much along with the programmer's intuition that it rarely bites anyone.
Indentation was seriously being used as a point against Python when I came to Ruby and we had lots of DSLs that where indentation based back then. I always felt that do be BS and I think it is meant seriously here too, in this article.
I do agree that isn’t an argument I have heard used seriously in a long time tough.
The usual argument is that bracketed syntax rather than indentation-based syntax makes it possible/easier to have multi-line anonymous functions (such as with Ruby's block syntax), and especially to use them within more complex expressions.
You can have indentation based syntax and ; for multiple statements in one line, or something even more powerful. But it doesn't matter.
Main power of blocks is not being multiline or being closure-like, many languages have this. But blocks are not just anonymous functions or lambdas, they have ability to return from the outer method (or from the method to which it was passed with break), acting as a powerful tool for creating your own flow control structures if needed, or just replacing "for". Of the languages I know or heard of only smalltalk does the same.
You can live without those, you can live even without early return, but blocks are not a misfeature, it's a great and intuitive tool. And python's rudimentary lambdas make me cry a little.
I have worked in ruby since forever, but I was reading a Clojure book recently and it looks like a straight upgrade over ruby, to the point I was shocked (many similarities but with more solid ground)
https://github.com/ronynn/ronynn.github.io/commit/f1bc45de82...
The syntax is more elegant. Well yes, but that’s also subjective. Also, the argument doesn’t help LISP to be more popular either.
The indentation argument is old and in my opinion hypocritical (yaml, sass, haml). Also, not getting code you copy and paste from the net to work because of syntax errors based on indentation is the least of the problems in copy and pasting code from the internet.
Selling the larger and more diverse library ecosystem of Python as an advantage for Ruby rather funny. Ruby has good libraries for the web and enough for *NIX scripting but I do wish we had some more stuff to keep up with Python when it comes to math, scientific computing and ML.
I have more fun writing Ruby and that is one of the main reasons I use it. And I think it is an easy enough programming language for a somewhat experienced programmer to pick up. DSLs, meta programming and some other advanced concepts are easy enough to pick up in Ruby and you can figure out the pros and cons for your self quickly. We still have a tradition of fun and quirky projects being done in Ruby. There is a gem to create your own card games and a video on YouTube about somebody building an agi upscaler, that code is in ruby.
My sales pitch would be: “Come join us, we are fun and a bit weird, just like our language. We are also fun at parties!”
Python's "there should be 1 obvious solution to any problem" culture is way better at scale than Ruby's "there should be 5 subtly different solutions to every problem". I hate the distinction between blocks, procs, and lambdas. Ruby's support for both `...` and `..` likewise does more harm than good. That extra period can be easy to miss while scanning code and we all know how much more important readability is than writability. I also don't like the difficulty to distinguish "magic" references from real ones, unlike in Python where all the magic references have double underscores. It once took me a half hour just to figure out why this seemingly normal method called `method_missing` was being invoked when it seemed like it shouldn't (this codebase was so large and classes had so many ancestors / mixins that finding method definitions was generally a problem. I also don't like mixins btw, or inheritance for that matter, but having 1 is better than having both).
I would discourage anybody from learning Ruby for the simple reason that large Ruby codebases are a scourge to our profession. Small Ruby codebases may be fine, and large Python codebases aren't great either, but I much prefer the language that minimizes all the weird gotchas.
And method_missing is a such fundamental part of the language, that it obvious you skipped basic docs on the language. Besides that, there're not many "magic references". Unlike in python, btw, where "there should be 1 obvious solution to any problem" mantra doesn't hold for a veeery long time.
C is generally not considered to be strongly typed but Ruby is. i.e. types aren't automatically coerced at runtime in Ruby.
Comments here say the article is a hack job, so I didn’t read it. That said, I don’t think it’s likely that either language is necessarily better for beginners (and I admit that I base that on nothing but my gut). But non-beginners are probably better suited to whichever more closely resembles whatever they’ve been comfortable with in the past.
Also, with the rise of LLM code generation for jobs like webdev, I get the feeling that lower-level programming skills are going to be increasing valuable for one's programming career.
The hard parts for beginners are identical -- e.g. for loops, functions, and finding the motivation to consistently practice.
Since then I’ve returned to Python for some projects and I find that Python made me better at Ruby and Ruby made me better at Python. JavaScript, Ruby and Python are my main goto languages for scripting and web programming and I think Ruby is getting the short end of the three languages. It deserves better and I think more people, especially web developers and people that need a *NIX scripting language should give it a try.
What I don’t really understand is that we (Ruby programmers) still use indentation for block definition as a reason against Python. Especially since yaml, haml and sass are technologies we helped build and popularize and they are all indentation based. I still agree that Python is the less elegant and more importantly the less fun language.
The article was written by an LLM[1], not a Ruby programmer.
[1](https://www.hackerneue.com/item?id=42102000)
Pythonistas generally consider that a misfeature.
Main power of blocks is not being multiline or being closure-like, many languages have this. But blocks are not just anonymous functions or lambdas, they have ability to return from the outer method (or from the method to which it was passed with break), acting as a powerful tool for creating your own flow control structures if needed, or just replacing "for". Of the languages I know or heard of only smalltalk does the same.
You can live without those, you can live even without early return, but blocks are not a misfeature, it's a great and intuitive tool. And python's rudimentary lambdas make me cry a little.
https://docs.toit.io/language/blocks-and-lambdas