From: Michael Greenly Date: 2006-08-07T21:46:15+09:00 Subject: Re: How to react on nil or wrong object-type as parameter >Robert Klemme wrote: > > No, duck typing means you just use those methods needed and if the type > doesn't match the caller gets bitten by an exception. You should of > course document what the method does. For example (silly method) Exactly. Your tossing one of the primary advantages of a language like Ruby out the window if you load your code up with all kinds of type checking. Why try and decide for every future caller what part of your code may be functional for their (unknown to you) purpose. Document what your code does, let the exceptions fly. Instead of defensive coding write decent automated tests to make sure you expect -- Posted via http://www.ruby-forum.com/.