|
|
|
|
|
by sc
6376 days ago
|
|
Sometimes you need (), sometimes you don't. Some people
think the lack of "unnecessary" parenthesis makes the
language more elegant, I just say it makes it harder to
determine if something is an attribute or a method, for
example.
Well, this is because Ruby, like Objective-C, is a strict OOP language, and there's no such thing as an "attribute" (all instance variables are private). When something looks like an attribute, it's a reader method that returns the attribute. |
|