From: Martin DeMello Date: 2005-10-29T22:17:05+09:00 Subject: Re: "Readability" inflation David A. Black wrote: > > I think what's happening is that people who've used Ruby for a while > get used to it, and then they sort of shift their readability > threshold. In other words, if you've seen this: > > a.map {|b| b.meth } > > for several years, then even though it looked beautiful and concise > and transparent to you at first, it will start to look verbose and > syntactically inefficient. So then you might want to have: I usually come around to agreeing with you that so-and-so change adds more line noise than is worth it, but this particular one I've disliked right from the beginning. It's not just the visual clutter, it's the conceptual overhead of introducing a new variable merely because ruby has to attach a method to something. Note the progression from ary.sort {|a,b| a.meth <=> b.meth} ary.sort_by {|a| a.meth} ary.sort_by :meth The |a| adds absolutely nothing to the readability of the code. It's a case of cluttering the simple case in order to support the complex one, and ruby usually manages to do a pretty good job of keeping machinery out of your way until you need it. martin