From: Jim Weirich Date: 2003-01-06T21:22:09+09:00 Subject: Re: Interfaces in Ruby (attempted summary) On Sun, 2003-01-05 at 15:18, Martin DeMello wrote: > Jim Weirich wrote: > > On Sun, 2003-01-05 at 13:38, Martin DeMello wrote: > >> Jim Weirich wrote: > >> > > >> > There are several reasons people like interfaces (and DbC for that > >> > matter) ... > >> > > >> > (a) They enable compile time static type checks. > >> > (b) They document the intended behaviour > >> > >> (c) They permit reasonably watertight multiperson projects. > > > > Isn't (c) a restatement of (a)? Or is there something other than static > > type checking that contributes to (c)? > > Aren't contracts distinct from static type checks? Oops ... of course. I mentioned contracts but then wrote (a) and (b) with interfaces in mind. With contracts in mind, I think I would express (c) like this ... (c') They validate that implementations provide the expected behaviour. Which, of course, unit tests can accomplish as well. -- -- Jim Weirich jweirich@one.net http://w3.one.net/~jweirich --------------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)