Re: "Readability" inflation



On 29/10/05, Dominik Bathon <dbatml@xxxxxx> wrote:
> On Sat, 29 Oct 2005 17:52:05 +0200, Trans <transfire@xxxxxxxxx> wrote:
>
> >
> > Brian Schröder 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!)
>
> So, what we really need is the implicit block variable, because it can do
> all that ;-)
>
> ary.sort_by { it.meth }
>
> ary.sort_by { it.meth(foo, bar, wack!) }
>
> and even:
>
> ary.sort_by { some_hash[it] }
>
>
> Dominik
>

What is so bad about

ary.sort_by { | it | it.meth(foo, bar, wack!) }

Then you can even make your sourcecode readable by putting information
into the it

playlist.sort_by { | track | track.meth(foo, bar, wack!) }
instead of
playlist.sort_by { it.meth(foo, bar, wack!) }

where it is unclear what the it is.

regards,

Brian

--
http://ruby.brian-schroeder.de/

Stringed instrument chords: http://chordlist.brian-schroeder.de/


.



Relevant Pages

  • OXO Question Regarding Chimes
    ... The large bar is for the 1000's ... You will see where it identifies which chime bar is ... Bally games so I have no real experience with the patterns and habits ... Would someone chime in here with some reality as to if Williams ...
    (rec.games.pinball)
  • Re: OXO Question Regarding Chimes
    ... That chime set up is different than is on this game. ... The medium bar is for the 10's ... Bally games so I have no real experience with the patterns and habits ...    (I currently can't get at my spare OXO I bought for parts to see ...
    (rec.games.pinball)
  • Re: LF: Bally EM 1000pt. Chime Bar Dimensions
    ... chime bar on a Bally EM. ... this box are made of a heavier metal than aluminum. ... which I assume is the 4th chime bar for a Bally SS ... I'll measure the bar on my Mata Hari tonight. ...
    (rec.games.pinball)
  • Re: Question on Bally EM chime unit
    ... The smallest bar is the 10 chime and the bigger the bar the higher the ... Remove the diodes. ... I've recently bought a 3-tone chime unit which I intend to install in my ... Unfortunately someone has cut off the wires so I have to put ...
    (rec.games.pinball)
  • Re: OXO Question Regarding Chimes
    ... The large bar is for the 1000's ... Bally games so I have no real experience with the patterns and habits ... chime bar and vice versa. ... Would someone chime in here with some reality as to if Williams ...
    (rec.games.pinball)