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: Quoted text in a message is not indexed
 
 
Originally created by
Tamarack Associates
Sun, 19 May 2024 23:56:29 UTC
Copyright © 2009-2024
HREF Tools Corp.