From: Ben Giddings Date: 2005-08-11T00:42:09+09:00 Subject: Re: Yet Another useless Ruby 2 Idea On Aug 4, 2005, at 13:20, Jeff Wood wrote: > Yeah, I figured that out right after I had posted my message... > > But still, you can see that the python syntax is quite a bit more > readable ( at least in this case ). I completely disagree. "item for item in items if item"? How is that easy to understand? The Ruby way may involve a few more keystrokes, but it's much more clear what's happening. items.select {|item| item > 2 }.map {|item| item * 2 } First you use "select", giving you an array, then you map the elements of the array to another. The temporary variables you create are obvious, unlike the Python example where you start using the variable even before you declare it, and the two tasks (selecting certain elements of the array, and manipulating those elements) are cleanly separated. To me, I can't tell if the "if item > 2" happens each time, or only once. I think it's like lisp. Once you get used to it, you can read it an parse it efficiently, but getting there is a real pain, and until your brain is used to those constructs it isn't at all intuitive. Ben