Article

From:
To:
Pete d'Oronzio
Subject:
Re: Exceptions vs Error codes
Newsgroup:
borland.public.delphi.objectpascal

Re: Exceptions vs Error codes


I think there are two objections to the manner of using exceptions that you
suggest. The first is that exceptions are heavy on cpu usage even when
caught within the same mehtod/function. The second is that it makes for
contorted code where a simple loop would have been both faster, less messy
and more readable.

It's probably worth pointing out that the word "exception" does not really cover expected situations. It's supposed to cover the unexpected which means that for which your program cannot be reasonably expected to cope. A user providing a path to a non-existent file, for example, or an alphanummeric string where a number is required.
Greg
FYI: Phrase searches are enclosed in either single or double quotes
 
 
Originally created by
Tamarack Associates
Fri, 15 Nov 2024 02:30:02 UTC
Copyright © 2009-2024
HREF Tools Corp.