Frank Mitchell <frankm / bayarea.net>
>
> Hmm ... isn't the whole point of Design By Contract to "fail fast"?

This is one of the things that go with it, but it's a (very desirable)
side effect, not its main thrust.

> Assertions are checked at runtime -- mainly because there's no
> general alternative -- but DbC serves to highlight problems
> early and with a minimum of testing/debugging.

That's true, but there's another important aspect: An early failure
prevents the error from spreading through the system. It's easier to
find an error if the error message comes early.

> Leaving something as crucial as what messages an
> object receives out of the contract leaves us testing
> every possible input again.  (I also believe not
> specifying the *contract* of each involved object's
> methods is a mistake.

And the set of routines that an object can execute, together with the
contracts on these routines, forms the object's type. In other words, if
you bother writing contracts at all, you should specify the types as
well.
This is not my standard gospel why DbC should go with static typing, but
it sounds reasonable.

Regards,
Joachim
--
This is not an official statement from my employer or from NICE.
Reply-to address changed to discourage unsolicited advertisements.