From: "Dave Thomas" <Dave / PragmaticProgrammer.com>
> If you want to do type testing, you should really use #respond_to?,
> not #is_a?, as that way you'll make explicit the operations that
> you're asking your object to have.
>
> Again, though, I'd question the usefulness of this.  What is the
> benefit of having an application die with an assertion failure at the
> top of a routine, when it will fail anyway with a NameError a few
> lines down?

I agree.  Another problem with adding precondition checks to a routine is
that each routine has to check it's preconditions and those checks are
usually the same as or similar to checks further down the call chain.  So
the program becomes littered with duplicate, redundant precondition tests.

Usual practice is for a routine to document but not check it's
preconditions, unless you are using a language with explicit support for
DBC.  You can test that callers of a routine are meeting the routine's
preconditions with unit tests and mock objects.