Article

From:
To:
Kristofer Skaug
Subject:
Re: Exceptions vs Error codes
Newsgroup:
borland.public.delphi.objectpascal

Re: Exceptions vs Error codes

In article <3b7d8b76$1_2@dnews>
	"Kristofer Skaug" <✉skaug.demon.nl> wrote:

> what I was now envisioning was a sequence like this:
> 
> try
>   {1}
>   try
>     {2}
>     try
>       {3}
>       try
>          {4}
>       finally
>           <rollback 4>
>       end; {4}
>     finally
>        <rollback 3>
>     end; {3}
>   finally
>      <rollback 2>
>   end; {2}
> finally
>   <rollback 1>
> end; {1}
> 
> I'm pretty sure any tight processing you want to do around the core part
> {4} is going to take a hit from all the extra try-finally infrastructure.

And how are you going to perform this differently in the absence of
exceptions; that is, using a motley collection error codes and ragbag
global variables, scattered hither and thither, every second statement a
check for error conditions?

> Especially if you now extend this to one try/finally pair per state
> parameter you need to roll back, and there may be 10 or more of those...

You speak of combinatorial explosion. There are ways to fold these.

-- Barry
FYI: When using a '+' or '-', be sure to precede it with a space unless it is the first character. Example: '+delphi -database', not '+delphi-database' (without quotes).
 
 
Originally created by
Tamarack Associates
Sun, 19 May 2024 21:45:35 UTC
Copyright © 2009-2024
HREF Tools Corp.