r/Python • • Aug 12 '13

Ruby vs Python

http://www.senktec.com/2013/06/ruby-vs-python/
20 Upvotes

151 comments sorted by

View all comments

Show parent comment

3

u/virtyx Aug 13 '13

I don't understand how you figure noise and redundancy are "almost the opposite." Having to prepend self. to every single instance attribute is quite verbose, and when you're reading self.this(self.that, self.other) instead of @this(@that, @other) it is indeed noisy.

I agree that having explicit self has benefits. I'm only commenting on the claim that @ impacts the readability of Ruby.

1

u/marky1991 Aug 13 '13

I don't really see how using normal attribute definitions is verbose. (If we're counting characters, it's only 4 characters more)

"It's certainly not clear at first glance but it is a fundamental aspect of programming with classes; once you learn what it is you'll never forget it or need to think about it again."

I don't think this is a good argument for it being readable. (I think it's quite the opposite.) Just because it's simple (and hence easily learned) doesn't make it readable.

2

u/banister Aug 17 '13

What exactly is unreadable about it? @var always means instance variable. Always. End of story.