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: The minus sign, '-', may be used to exclude a word from the search (e.g. +delphi -database)
 
 
Originally created by
Tamarack Associates
Sun, 19 May 2024 21:45:34 UTC
Copyright © 2009-2024
HREF Tools Corp.