From: Esmail Date: 2007-08-27T08:10:04+09:00 Subject: Re: How can I make this if/else more succinct? Logan Capaldo wrote: > On 8/24/07, eggie5 wrote: >> Actually how can this be more succinct? >> >> Video.find(:all).each do |video| > ext = %w(_3gp _3g2 mp4).find { |m| video.send(m) == 1 > }.to_s.sub(/\A_?(.+)\z/, '.\\1') >> expected.push "#{self.id}_#{video.id}#{ext}" >> end this is not meant as a flame, but this reminds me of the "write only" code I used to see when I programmed in C. If given the choice between the two, I would prefer the original as it's easily comprehensible and to modify. One of the things I like about Python and Ruby is that they encourage/enable clean readable code, so I find the above going against the design philosophy of the language. Comments? Please, I am not looking for an argument here.