Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2000-08-11 13:08:19


----- Original Message -----
From: "Ian Bruntlett" <Ian.Bruntlett_at_[hidden]>

> I'd use something like "Expectedness" if I had my C++ Design head on.
> And "stack unwinding or not?" if I had my C++ Implementation on.
>
> Ian
> (not Wurzel Gummidge).

I think you're being distracted by the term "stack unwinding". Forget about
that for a moment; just consider whether the client wants to handle the
condition locally.

I recently had a discussion with a junior colleague about when to use
exceptions vs. when to use assert, and he concluded the conversation by
observing, "So, exceptions are for errors we *expect* to happen". In
context, his observation was perfectly accurate. We use exceptions for
things like running out of memory, which (on our platform) is a possible
scenario from which we need to recover. We use assertions to catch
programming errors (violations of preconditions), i.e. conditions we don't
expect to occur once our code is debugged and shipped.

Many other experienced people come to the opposite conclusion about
"expectedness". The problem is that "expectedness" is a poorly-defined,
qualitative term.

-Dave

P.S. In this case, I don't even think the timeout condition neccessarily
represents an error, though I'm not religious about exceptions being used
only for error conditions. Of course, "errorness" may be another qualitative
term.


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