Ryan Pavlik wrote:

>On Fri, 14 Mar 2003 13:00:07 +0900
>"Jason M Jurkowski ;002;icsg6;" <jmj8237 / cs.rit.edu> wrote:
>
><snip>
>  
>
>>exactly.  i believe  eiffel makes a big deal about them as part of "design
>>by contract"
>>    
>>
>
>I believe "design by contract" is flawed, but that's another
>discussion entirely.
>
DBC is probably flawed in the context of Ruby.  In Eiffel it makes a lot 
more sense.  In Eiffel you know what type something is going to be 
allowed to be.  In Ruby assertions would probably only mean something 
like 'This isn't a kind of data I'm prepared to deal with", valuable 
information, but not necessarily a sign of an error.  In Eiffel this 
would be a design error.

That said, there are many times when I believe that I *do* know what 
types should be allowed.  If I'm expecting a number, and you pass me a 
point, then something's wrong.  I defined (say) multiplication to work 
between two real numbers.  And you are passing me a thing that I wot not 
of.  So somebody else needs to deal with it.  This could be seen as what 
an assertion should be about.  (Actually, Eiffel's assertions are a lot 
more specific than that.  And in the context of Eiffel they make a lot 
of sense.)

The main job being handled here is detecting errors, and figuring out 
how to deal with them.  Eiffel is better at the first part, and Ruby is 
better at the second part.
...

-- 
-- Charles Hixson
Gnu software that is free,
The best is yet to be.