Reading Ruby
I just had a conversation with a nonprogrammer coworker about a problem in our application. He sent values into an action on our site, and it didn’t return what he expected. The problem was he sent in incorrect values. So, I went to my code and pasted the following code snippet to him:
when 9,10,11,12 then "Still in High School/ No Degree" when 13 then "EDLV1" when 14 then "EDLV2" when 15 then "EDLV3" when 16 then "EDLV4" when 17,18 then "EDLV5" when 19,20 then "EDLV6" when 21 then "EDLV7"
Now, I normally give clarification to what’s going on with code, but in this case, it was obvious. He understood right away without any further explanation.
I love the readability of ruby!
Posted on Oct 22, 2009
|
Add a comment
Add a Comment