From: Gary Wright Date: 2011-09-13T12:48:09+09:00 Subject: Re: Any downsides to writing paranthesises? On Sep 12, 2011, at 9:19 PM, Eric Christopherson wrote: > On Mon, Sep 12, 2011 at 8:09 PM, Gary Wright wrote: >> >> On Sep 12, 2011, at 8:23 PM, Dave Aronson wrote: >>> Yup. :-) Another reason to omit the parens is so that clients don't >>> need to be tweaked by adding or removing parens if implementation >>> moves between a function, a public variable (yes, generally bad >>> practice, but it happens), or a var with an attr_reader (ah, that's >>> better!). >> >> I agree with this except that there is no such thing as a 'public variable' in Ruby. Not sure what you are referring to there. > > And a var with an attr_reader is really just a method. I've seen this > justification of going without parentheses in a book, too, and it > didn't make any more sense to me then. I think the "uniform access principle" is a good one (http://en.wikipedia.org/wiki/Uniform_access_principle). I was just flagging the "public variable" terminology, which I don't think is meaningful in a Ruby context. Instance variables are never directly accessible in Ruby so there is no concept of access control to instance variables. They must be accessed through instance methods (Kernel#instance_variable_get is the "loophole" to this but even that is a method and not simply syntax). Gary Wright