From: Richard Dale Date: 2004-08-19T20:35:57+09:00 Subject: Re: When to use parentheses around method args? Martin DeMello wrote: > George Ogata wrote: >> Richard Dale writes: >> >> > Are there any rules of thumb for when it's a good idea to leave out the >> > brackets and when to use them? >> >> I don't think there are "rules of thumb" for definitions, but assuming >> you have a newline after the args (i.e., you're not squashing a whole >> def...end on one line or something), parens on def-lines are _always_ >> redundant, thus I _never_ use them. Perhaps it's just Emacs' syntax >> highlighting, but I find it perfectly clear, even for operator-defs >> like "def << x". > > Whereas I always use them for defs, since it fits my perception of x as > a placeholding parameter rather than a value. That's what I've done so far, but I might try Mikael's suggestion: Mikael Brockman wrote: > In method definitions, I use parens unless there's only one argument. > In method calls, I use parens when I need to, or when omitting them > looks weird. But thanks everyone for the comments - I think I need to read more of other people's ruby code and then judge which style I prefer. If you have a smalltalk background like Martin Fowler, I suppose the brackets must just look like noise.