gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu-arch-users] Nit


From: Andrew Suffield
Subject: Re: [Gnu-arch-users] Nit
Date: Mon, 20 Oct 2003 15:14:35 +0100
User-agent: Mutt/1.5.4i

On Mon, Oct 20, 2003 at 08:21:13PM +1000, Robert Collins wrote:
> On Mon, 2003-10-20 at 18:56, Thomas Zander wrote:
> > Its all the things that people use Exceptions for; since it allows for bugs 
> > to be made without creating non-sane conditions, which allows creating 
> > software bug-free the first time around.
> > You are right that c can do this; but most developers just don't because 
> > its 
> > so damn hard!
> > 
> > How often is a malloc done without a check if it succeeded?  Do a grep to 
> > find out, same with file-open and all those nice little problems.
> 
> Y'know, reading hackerlab would be a very good start for you, as you
> appear to be talking from a position of ignorance [of tla's internals]
> rather than one of knowledge.
> 
> Oh, and as for exceptions being 'all that' ? Exceptions don't prevent
> bad state in objects, they don't prevent bugs, all they do is ensure
> that cleanup routines have a chance at trapping abnormal events within
> the same process.

Most of the time they don't even do that.

All that exceptions normally give you is a more descriptive error
message.

If you want to actually handle the error and continue in a sensible
fashion, then you need to design your interface to clearly and
usefully define the error states it can cause, and probably provide
some cleanup/restart handling. Once you've got that, you don't need
exceptions any more, because it's just part of your library
interface.

-- 
  .''`.  ** Debian GNU/Linux ** | Andrew Suffield
 : :' :  http://www.debian.org/ |
 `. `'                          |
   `-             -><-          |

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]