From: Charles Steinman Date: 2005-07-19T04:05:54+09:00 Subject: Re: What does this construct mean? Ara.T.Howard wrote: > the best reason is the example you posted - one can make methods which read > like syntax additions/declarations. the built-in > > class C > attr_accessor 'a' > end > > which (just in case you didn't know) automatically generate accessor methods > for C objects as in > > obj = C::new > obj.a = 42 > p obj.a #=> 42 > > and this reads really nicely. another good reason to ignore parens is for > boolean methods like > > if array.emtpy? > array << 42 > end > > i think most would agree that this looks better than > > if array.emtpy?() Or even worse if array is gotten through an accessor, in which case you'd have "if array().empty?()", which is just rancid.