Re: Tasty exceptions
- From: "Michael C." <Michael@xxxxxxxxxx>
- Date: Fri, 30 Jun 2006 12:16:01 -0600
Craig Stuntz [TeamB] wrote:
<snip>
generally speaking I see no advantage of turning an exception into an
error code in terms of a function result (as opposed to logging), and
you still must abort through one means or another. I think people tend
to do this when they haven't thought their call stack through carefully.
Generally, I can see 2 advantages to turning an exception into an error code:
1) To suppress useless exceptions.
Sometimes all you want to know is if something succeeded or failed.
In this case, you could really care less what the exception was and you still want
your programs execution to proceed.
2) Sometimes one can respond more efficiently to an error code using a case or an if statement
instead of using an exception handler.
The point is this: When a contract has been violated, your objects are
in an undefined state. That's dangerous.
An object can be in a defined state while dealing with all local exceptions locally.
That wouldn't be dangerous.
.
- Follow-Ups:
- Re: Tasty exceptions
- From: Craig Stuntz [TeamB]
- Re: Tasty exceptions
- References:
- Tasty exceptions
- From: Blackbird Crow Raven
- Re: Tasty exceptions
- From: Nick Hodges (Borland/DevCo)
- Re: Tasty exceptions
- From: Arthur Hoornweg
- Re: Tasty exceptions
- From: Jon Robertson
- Re: Tasty exceptions
- From: Craig Stuntz [TeamB]
- Re: Tasty exceptions
- From: Michael C.
- Re: Tasty exceptions
- From: Craig Stuntz [TeamB]
- Re: Tasty exceptions
- From: Michael C.
- Re: Tasty exceptions
- From: Craig Stuntz [TeamB]
- Tasty exceptions
- Prev by Date: Re: Captain Jake's Top Ten List of what I'd like to see in thenextversionofDelphi
- Next by Date: Re: Tasty exceptions
- Previous by thread: Re: Tasty exceptions
- Next by thread: Re: Tasty exceptions
- Index(es):
Relevant Pages
|
|