Trans <transfire / gmail.com> wrote:
> Brian Schröäer wrote:
>> If you are so bold, I have to chime in again to say that
>>
>>   ary.sort_by :meth
>>
>> reads a lot better than
>>
>>   ary.sort_by.meth
>>
>> because we don't do method chaining here.
>>
>> Sorry, could not resist. ;-)
>
> Ahhhhh... but can you do:
>
>    ary.sort_by.meth(foo, bar, wack!)

I think it'd rather be

ary.sort_by(:foo, :bar, :wack!)

This is definitely superior to chaining methods.  For one, because chaining 
causes the wrong perception that the chain is executed once but in fact a 
proxy object is created behind the scenes that applies the rest of the chain 
to every instance.  And also the proxy object might be slower than the 
direct execution of the chain.  Just because it's possible it doesn't mean 
it's better or more readable.  My 0.02 EUR...

Kind regards

    robert