On Tue, Feb 17, 2009 at 9:44 AM, Juan Zanos <juan_zanos / talkhouse.com>wrote=
:

>
> On 17 f=E9vr. 09, at 01:16, David Masover wrote:
>
>> I like Ruby's relaxed syntax. I like letting things like parentheses be
>> implied, leading to interesting, emergent phenomena like hashes as named
>> arguments. (Not that I would complain if the language implemented named
>> arguments -- even better if I don't have to use them as a hash -- so lon=
g as
>> I can if I need to.)
>>
>> I like the ability to create good-looking DSLs, but that's similar to th=
e
>> above.
>>
>
> It's possible that without the humble feature of optional parentheses Rak=
e
> would never have been invented and I might never have been compelled to t=
ake
> a serious look at Ruby.  Since then I've often wondered why parentheses a=
re
> still so heavily used in most Ruby code even when they  offer no compelli=
ng
> utility for most uses.  In contrast, omitting unnecessary semicolons seem=
s
> almost universal.  I suppose parentheses are more habit forming for some
> reason.


IMHO, coding Ruby without parentheses is a particular kind of spice.
Whether you should use a particular spice depends on what you are cooking.

The parentheses free style works well for certain internal DSLs like Rake o=
r
ActiveRecord association declarations, since they make run-time executed
expressions feel declarative.

On the other hand, I've always found leaving out parentheses in Ruby code,
"just because you can" to tend to look far stranger to my eye than putting
them in. In fact, sometimes when reading code without them I find myself
having to read very slowly in order to figure out just how Ruby is parsing
what I'm reading.

--=20
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale