News for hackers. Stuff that matters.
Re:IF-less programming by jbrains on Friday December 28, 2012 @08:20AM (#4977569)
Not an if statement, but unnecessarily clever code that doesn't reveal its intent. An example of the tension between general clarity and a concise, well-known idiom. The kind of thing that makes C++ impenetrable to those who don't write it regularly.

I'd rather add a method to Object/Nil called something like #or_else so that we could write

  param = object.property.or_else(default_param)
which, though still terse, at least describes what's going on.

There are no comments on this comment yet.