Article

From:
To:
Barry Kelly
Subject:
Re: Exceptions vs Error codes
Newsgroup:
borland.public.delphi.objectpascal

Re: Exceptions vs Error codes


"Barry Kelly" <✉eircom.net> wrote in message
news:✉4ax.com...
>
> Why do you need to handle the errors? If you really need to handle the
> errors, then (IMO) the operations should be in completely separate
> functions, so that you can eliminate the drudgery of handling the same
> errors over and over again.

Correct, this is a factoring exercise and is usually incurred at some
point (sooner or later) unless we are talking about a very very specific
sequence (like a system self test sequence which is specified to abort
after the first detected error...)

> If you feel it's cluttered, have you considered making your operations
> nested functions, like:
> <snip, grokked code>
>
> Just an idea; it works for me.
>

An interesting approach in some cases, certainly.

Kristofer
FYI: Phrase searches are enclosed in either single or double quotes
 
 
Originally created by
Tamarack Associates
Wed, 09 Oct 2024 17:13:46 UTC
Copyright © 2009-2024
HREF Tools Corp.