top | item 32159492

(no title)

kuang_eleven | 3 years 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!

discuss

order

philovivero|3 years ago

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.

synergy20|3 years ago

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.

brigandish|3 years ago

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

joshuamorton|3 years ago

Yes, up until the mention of multiple inheritance, I thought the post was mediocre satire.

drcongo|3 years ago

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.