From: Dave Thomas Date: 2001-08-05T23:08:25+09:00 Subject: [ruby-talk:19166] Re: My 1st look @ ruby: No prototypes and problem with String#gsub stesch@no-spoon.de (Stefan Scholl) writes: > Or is it common pratice to check these with defined?(data.[]) and > defined?(data.length)? This way it's easier to find a bug when > calling Shuffle#new with the wrong object. The interpreter will find the bug for you, so I wouldn't bother. There _are_ cases where I would check. One is when the actual call to the method won't occur immediately. For example, observer.rb checks to see that the parameter to add_observer responds to 'update'. This is reasonable, because the actually call to update could happen half-an-hour later. If that called failed, you may have lost context in which to diagnose the problem. Regards Dave