Why exceptions for error handling is so important
via Digitalmars-d
digitalmars-d at puremagic.com
Mon Jan 12 13:42:41 PST 2015
On Monday, 12 January 2015 at 21:03:43 UTC, Walter Bright wrote:
> Bringing up IEEE 754 FP exceptions as an example of it being
> "done right" when it is a complete failure severely damages
> your case.
I am bringing up exception-handling as what it is. Handling an
exception involves resolving an issue and continue if suitable.
Traps. Exceptions. Whatever. Has been available in CPUs since the
dawn of time. It is just a means to defer decisions to the
context before continuing.
The fact that this puts an unrealistic demand on library authors
to be excellent designers, and language design issues, resulted
in the cheap solution which basically is transactional: roll back
and try again with new parameters. That is of course more
inefficient than resolving the issue in situ, but easier to
design.
More information about the Digitalmars-d
mailing list