ruby nil closures symbols exceptions
In this previous post we’ve considered the benefits and inconveniences of using nil and symbols as return values in a method. Now we’ll evaluate the possibility of throwing an exception, and yet another alternative: using a closure.
29 Sep 2014
ruby nil closures symbols exceptions
Recently I’ve read a tweet from Yehuda Katz in which he suggested an interesting idea, as an alternative for using nil as a result from a method: to use a symbol instead.
Well, this post is about the reasons why I think you shouldn’t use a symbol, and why even returning nil is a preferable option.
24 Sep 2014