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...
> > >
> > > [... about state recovery ... ]
>
> It isn't very difficult in Object Pascal with correct use of
> try..finally.

For simple things I agree (e.g. reclaiming a chunk of memory, closing a
file etc). However in more complex state machines, an unhandled exception
generally means "game over" unless you add a *lot* of recovery code.

I think the main problem is that we are talking about different approaches to error handling driven by different application areas. For 99% of the Delphi community, program-level fault tolerance is apparently irrelevant in practice.
> Specification of anticipated exceptions is a misguided dead-end.

Discussed before - you know my views on this.

> Unfortunately, error codes can make code all but unreadable.

As can exception handling geared towards error containment and recovery
when there are no error codes available.

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