Hacker News new | ask | show | jobs
by kuang_eleven 1431 days ago
Interesting. Even with the examples given, I found Python considerably easier to follow, with the possible exception of the inheritance example.

Just goes to show how subjective it all is!

4 comments

Indeed. I started working with Ruby for at least a year before I started working with Python. To this day I still can't do anything useful in Ruby, and I'm proficient in Python.

Python is far more readable and comprehensible than Ruby.

Haven't even bothered to read TFA because it's just weird flamewar bait.

I agree, ruby's @ and @@ probably will make it a bit harder to read for anyone that is new to both languages, plus it seems more lengthy to me, python wins.
As an aside, it's bad practice to use @@ variables (IMO), they're easily clobbered. Class instance variables are much better[1].

I might also add, if you create getters for an instance variable then you don't need to use the @, except in the getter itself (and you don't even need to do that as there is the `attr_reader` helper for that).

[1] https://maximomussini.com/posts/ruby-class-variables

Yes, up until the mention of multiple inheritance, I thought the post was mediocre satire.
Same. The amount of boilerplate and "unnecessary" symbols in Ruby make it considerably less readable to me. The Python examples aren't just readable, they're glanceable.