Ruby-ize this

Posted by amy in Ruby Add comments

If you’re interested in making your code more ruby-esque, ruby fleebie has an ongoing feature called Ruby-ize this.

3 Responses to “Ruby-ize this”

  1. john Says:

    And the solutions are mostly one-liners . . .

  2. rainyglade Says:

    Just curious, is it better to go for clarity in code, or for something totally obscure that fits into a one-liner? I’m thinking in particular about a nested if statement. If put into a conditional within a conditional, the result could be very confusing, while the nested if structure seems more clear.

  3. john Says:

    Clarity.

    Good one-liners are clear (the assignment was a special case where we emphasized one-liner-ness over clarity). If a one-liner starts to edge towards cloudiness, bring in the sun, and expand it to multiple lines.

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Login