|
Boost : |
From: Beman Dawes (bdawes_at_[hidden])
Date: 2001-03-17 16:53:33
At 02:43 PM 3/17/2001, David Abrahams wrote:
>IMO using the question "is this an exceptional situation?" to decide
>whether
>to throw an exception has an attractive ring to it, but is usually a
>mistake. A more appropriate question to ask is: "do we want stack
unwinding
>here?"
>
>As a developer, if I have violated a precondition of a library I'm using,
I
>don't want stack unwinding. What I want is a core dump or the equivalent
-
>a
>way to inspect the state of the program at the point where the problem
was
>detected. That usually means assert() or some equivalent.
>
>I have sympathy with the idea of making resilient APIs which can stand up
>to
>nearly any kind of client abuse, but there is usually a significant cost
to
>this approach. If someone wants that sort of protection, it can usually
be
>provided as a layer on top of a simpler API. I am utterly unsympathetic
to
>half-measures, though. An API which promises resilience against some, but
>not all abuse is an invitation to disaster.
Dave,
Please, please, please, convert the above to HTML and stick it in
boost-root/more.
Then I have to figure a way to hardwire my brain to always read the page
before I design a new interface or new error detection code to an old one.
Thanks,
--Beman
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk