[zeromq-dev] Java API is not notifed of C++ assert failures.
Pieter Hintjens
ph at imatix.com
Mon Apr 20 15:12:46 CEST 2009
2009/4/20 Martin Sustrik <sustrik at fastmq.com>:
>> By trying to predict the exact reason for the assert - bug, incorrect
>> usage or whatever - you're only getting yourself deeper into trouble,
>> because there will always be a "surprise" reason that you didn't foresee.
IME the proper use of asserts is for internal consistency checks.
That is, when the code detects a fatal error in itself, or a fatal
error in the environment, or a fatal error in the caller. Anything
that makes the process dangerous to continue, and which needs
intervention.
It's a truism that bugs which do not cause pain do not get fixed. So
the pain that asserts cause is exactly meant to ensure the bugs get
fixed. One has to of course balance that pain against the weight of
the bug.
-Pieter
More information about the zeromq-dev
mailing list