Wednesday, June 19, 2013

Don't check - tell, in Ruby

Here's a neat idiom: instead of checking for a null pointer return, use a do construct in Ruby to either act on the return or not (if it's null). Very slick and elegant.

No comments:

Post a Comment