3 ms·
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.
by synergy20 4y 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 4y agoAs 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 https://maximomussini.com/posts/ruby-class-variables