News for hackers. Stuff that matters.
Re:Evil Ruby by damncabbage on Wednesday January 23, 2013 @09:03PM (#5106661)
I'd argue that it's really two functions:

* One to do the lookup and potentially explode; this always takes an argument.

* A second to provide the default.

Have the caller call the appropriate one. User provides params[:search] (or some other "explicitly trying to search"), then call the first. If not, call the latter.

There are no comments on this comment yet.