Barry Kelly
Re: Exceptions vs Error codes

Re: Exceptions vs Error codes

"Barry Kelly" <‚úČ> wrote in message
> 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.

FYI: Phrase searches are enclosed in either single or double quotes
Originally created by
Tamarack Associates
Sun, 03 Mar 2024 23:43:15 UTC
Copyright © 2009-2024
HREF Tools Corp.