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