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: Phrase searches are enclosed in either single or double quotes
 
 
Originally created by
Tamarack Associates
Fri, 15 Nov 2024 02:28:43 UTC
Copyright © 2009-2024
HREF Tools Corp.