From: Robert Klemme Date: 2012-05-31T01:23:42+09:00 Subject: Re: Don't override it - Use it On Wed, May 30, 2012 at 5:50 PM, Doug Jolley wrote: >> By the way: In Ruby you can leave out the parentheses for method calls >> (unless there's ambiguity). So instead of >> >> puts(clubs.suit().inspect()) >> >> you can simply write >> >> puts clubs.suit.inspect > I've been meaning to respond to this.  Yes, I am aware of that fact. > Some claim that it makes the code more readable.  I actually think that > it does the opposite  and makes the code less readable.  The reason that > I think that is that when I am reading Ruby code and I encounter an > identifier by itself, I don't really know whether that identifier is a > variable or a method.  If I see an identifier followed immediately by > '()'; then, I know for sure that that identifier is a method. > Consequently, I try to remember to use explicit parenthesis.  I doubt > that I do a very good job; but, that's my thinking. You need to do whatever feels best for you. I'd just add if you do not know whether something is a method or a local variable then your methods might be too long or you use too many variables. :-) Btw, in this particular case there is an even better way to rewrite the code: p clubs.suit or, if you prefer parens p clubs.suit() p(clubs.suit()) If you need to inspect more complex structures results are better when doing require 'pp' pp clubs.suit pp clubs.suit() pp(clubs.suit()) Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/