Article

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

Re: Exceptions vs Error codes

In article <3b7cf1bc_2@dnews>, ✉satserv.nl says...
> > Most arbitrary exception specifications will be useless
> "useless" maybe a little harsh. 

Well, I meant that we dont have so much freedom when
defining useful exceptional behavior. For example, here
is an arbitrary - and useless - exception behavior :

function Factorial(N : Integer); begin   case N of     0: Result := 1;     1: raise EFactorial.Create(1);     2: Result := 2;     3: raise EFactorial.Create(6);     4: Result := 24;     5: Result := 120;     6: raise EFactorial.Create(720);     ...   else     raise EFactorialOutOfRange.Create(N);   end; end;
> So learning to integrate code from other people has to 
> be part of your "bag'o'tricks".

Sure. Not much freedom is still much enough to generate
clashes.

--- Raoul    
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 22:38:05 UTC
Copyright © 2009-2024
HREF Tools Corp.