From: Bill Kelly Date: 2009-02-20T01:34:36+09:00 Subject: Re: What are your favorite Ruby features? From: "Juan Zanos" > > One of the things that confuses this discussion is that some people > are talking about the use of parentheses with regard to operator > precedence rules and others are discussing far more arbitrary and > questionable usages such as in declaring and calling functions. I > think it's telling that such a seemingly minor complexity is cause > for confusion. Again: >> === >> def initialize foo, bar, batz = {}, &block >> #(vs.) >> def initialize( foo, bar, batz = {}, &block ) >> === Nowadays, my brain finds the latter declaration with the parens, more restful to the eye than the former. It's easier for me to see the structure at-a-glance in the latter.... I find these reasons sufficient and non-arbitrary. > I doubt you'll get much disagreement that operator precedence rules > for c (or Ruby) are complex enough that there are cases where the use > of parentheses simplifies reading. That doesn't seem to be > something anyone is questioning. But we do get disagreement among programmers as to the *degree* to which parens ought to be used to clarify operator precedence. The same kind of disagreement happens in C with regard to whether and when to use braces when the body of a conditional is a single statement. if (foo) bar(); else baz(); if (foo) { bar(); } else { baz(); } if (xyzzy) if (foo) bar(); else baz(); if (xyzzy) { if (foo) bar(); else baz(); }