Re: assertions: does it matter that they are disabled in production?
In article <rud9a41ggp785nohs4eclm9d7m3t06g8fu@4ax.com>,
Geoff <geoff@invalid.invalid> wrote:
If you are going to hand software to customers that is debug code, say so
explicitly and hand him debug code. Don't hand him "release" code and allow
it to crash.
It sure beats your alternative of handing them "release" code which
silently attempts to swallow unpredictable programming errors.
Yes, end users can hand you bad data that no amount of
in-house testing can reveal
Again, it has nothing to do with bad data. It has to do with detecting
programming errors.
Can't trust your code? Do you think the pilot of an F-22 cares about
recording and reporting the output of your assert macro while he's pulling
the eject handle?
Or your code where the plane ignores the eject handle because of a
detected but ignored software bug?
ASSERT obviously has to do something different than abort in the case of
a jet fighter. I'm not arguing against that. It has to get whatever
program it is running from its current unpredictable state to a well
known state that the code can handle. Silently ignoring the programming
bug you just detected rarely accomplishes that.
--
Nevin ":-)" Liber <mailto:nevin@eviloverlord.com> 773 961-1620
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]