On Apr 2, 2006, at 10:36 AM, Robert Dober wrote:
> On 4/2/06, gwtmp01 / mac.com <gwtmp01 / mac.com> wrote:
>> On Apr 2, 2006, at 10:12 AM, Robert Dober wrote:
>>> Interesting points, please be aware though, that the runtime
>>> environement
>>> would not be burdened at all.
>> I don't follow.  Wouldn't each method call involve executing the pre-
>> condition tests?
> No it would not unless specified, but look at the nice idea Austin  
> has given
> us above, makes it much clearer.
>
> * precond and postcon blocks.
>
> Wouldn't that allow for great possibilities with rdoc and switching  
> them
> on/off with switches.

Just to clarify.  I think there is great value in programming-by- 
contract.
Being able to specify pre and post conditions (and class invariants)
in the same language as the code is great also.  Unit testing is good.
A way to combine all these things in a development environment would  
be great.
If this approach kept to the spirit of the Ruby syntax/style; didn't
incur any run-time costs; and was integrated into the documentation,  
editing, and
testing tools it would be wonderful.

The part that rubs me wrong is the idea that the 'production' code  
needs to
also run all those pre-condition tests on each and every method call  
and the
tendency to *over* specify the pre-conditions that interfere with the  
flexibility
of a dynamic language (duck typing).  Over-specified runtime pre- 
conditions bake in
extra assumptions that make the code more rigid than necessary (i.e.  
Austin's
example of expecting '<<' but nothing more).


Gary Wright