From: Robert Dober Date: 2008-06-19T14:57:32+09:00 Subject: Re: Rather validate values or use exceptions? On Thu, Jun 19, 2008 at 3:23 AM, Sam Smoot wrote: Another point might be which exceptions to rescue! I once thought to be very smart and ducktypy by catching NameError instead of checking for #respond_to? The code really looked quite nice def whatever o = some_way_to_get_it message = some_other_way_to_get_it o.send message rescue NameError say_something_not_so_nice end But I had a mistype deep in the call stack of some_way_to_get_it. Was one of the worst debugging session I ever had. Cheers Robert -- http://ruby-smalltalk.blogspot.com/ --- Les mêmes questions qu'on se pose On part vers où et vers qui Et comme indice pas grand-chose Des roses et des orties. - Francis Cabrel