Boost logo

Boost :

From: Kevin Atkinson (kevinatk_at_[hidden])
Date: 2000-06-10 23:37:57


--- In boost_at_[hidden], Branko Èibej <branko.cibej_at_h...> wrote:
> Kevin Atkinson wrote:
> > I think that safety should be the default when debugging a
program, but
> > when compiling for production use efficiency should be the default
> > *unless* the cost of safety is cheap as for as efficiency goes.
>
> You're assuming here that the safe implementation will catch *and
> warn about* all the programming errors that would cause the
efficient
> implementation to misbehave. If you don't guarantee that, the result
> will be hard-to-find bugs that never show up in "debugging" code.

The behavior of the program should not be different when debugging
than when not debugging except that the debug code will crash exactly
where the real bug is instead of in some mysterious place, or won't
print an warning when something looks specious. For this reason debug
checks should never throw, they should crash the program at the point
of error or output some kind of warning message. They should never do
something that will correct the problem. If you stick with these
rules they will never be any bugs that won't show up in the
"debugging" code because the behavior of the program has not changes.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk