Re: Exception Misconceptions
On Dec 17, 8:11 pm, Brian <c...@mailvault.com> wrote:
On Dec 17, 12:27 pm, James Kanze <james.ka...@gmail.com> wrote:
[...]
The machinery isn't that complicated. After all, you need to be
able to walk back the stack in other cases as well (e.g. in a
debugger---and what compiler doesn't come with a debugger). The
alternatives are relatively expensive, and some people do choose
their compiler based on benchmark results (and those benchmarks
rarely test the performance when an exception is thrown). For
better or worse, performance is an issue for compiler
vendors---lower performance means less sales.
When buying a car I care about how fast it goes from
0 to 60. There's flexibility about the range for that
with me, but if a car is two to three times slower
than others in that regard, it's a big red flag
So you won't consider cars like the VW Golf, since a Ferrari does
accelerate two or three times fasters.
Actually, I'm sure you didn't think that statement out. Performance
is
only one of many issues---I'd guess that correctness would be the most
important one (but even there---correctness is only important for the
features you use). Or even availability: early implementations of
exceptions used the slower mechanism because they could get the
implementation out the door quicker that way. And so on.
--
James Kanze