Rubyize this : 4th edition

The 3rd edition marked the beginning of a new association between Rubyize this and RefactorMyCode. I did things in a rather clumsy manner, telling people about how cool RmC was while asking them to use pastie to submit their refactored version of the code. At that time I didn’t realize that RmC and Rubyize this were ready to work together.

Well, RmC is now the official way to submit your rubyized solution. With the trackback system in place, a link to your refactored code will appear here at the moment you hit the submit button on RmC.

Before diving into the 4th edition, I’d like to take a moment to talk about the results of the 3rd one. We started with something pretty ugly that turned onto something pretty awesome!. On a side note, I really liked how some participants transformed the already mean sentence into something even meaner. As an exemple, the test sentence was : « You truly are a moron, sir! » and someone changed it to « you truly are a stupid moron sir! ». Someone else add fuel to the fire by writing « you truly are a ‘stupid’ moron, stupid sir! ». And finally, someone went as far as to write : « Stupid wabbit! Stupid, stupid, stupid! ». The situation was completely uncontrollable!

Enough said. Let’s get the ball rolling.

I have an array of insects and I want to be able to display on the screen the name, the iq and the annoyance factor of every members of a certain type. This “solution” works but has a ruby rating of 0.5/5. Moreover, it only works for butterflies… which feels rather incomplete and limiting. Remove stuff, add stuff and move stuff around. This dumb code must get smart and pretty!

Give it a shot now!