F i L:

> Why/where should I use contracts vs debug statements?

This is a sting point:
http://en.wikipedia.org/wiki/Design_by_contract

Contract-based programming is a different way to write programs. But adding few 
more asserts here and there is useful still.


>     int foo(int bar)
>     {
>         debug assert(bar != 0);

Asserts go away with -release. So generally I don't need to write that.

Bye,
bearophile

Reply via email to