From: Gregory Brown Date: 2009-03-02T23:36:10+09:00 Subject: Re: Rub 1.9: "inline rescue" doesn't work? On Mon, Mar 2, 2009 at 3:18 AM, Michal Suchanek wrote: > 2009/3/2 Gregory Brown : >> But please, don't use this technique.  It creates huge debugging nightmares. >> >> Instead, just do: >> >> aaa = obj.respond_to?(:capitalize) ? obj.capitalize : 444 >> >> > I'd see it as a Ruby's failure that the proper check is against DRY. Agreed, but the costs of the elegance of using rescue as a conditional modifier stack up fast in any moderately complex system. -greg -- Technical Blaag at: http://blog.majesticseacreature.com Non-tech stuff at: http://metametta.blogspot.com "Ruby Best Practices" Book now in O'Reilly Roughcuts: http://rubybestpractices.com