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: Thomas Zander
Subject: Re: [Gnu-arch-users] Nit
Date: Mon, 20 Oct 2003 16:51:37 +0200
User-agent: KMail/1.5

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 20 October 2003 16:14, Andrew Suffield wrote:
> 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.

This kind of reasoning is why I said that I don't buy into 'tla is stable'.
Its clear I can't explain exception aware programming in a single email; and 
it really is not the place to do so either.  I'll just be considered a 
troll that has no idea how to program good C code (that last part is 
probably correct :). While I feel you guys are missing out on where 
exception programming can make your program more robust and easier to 
debug.
For the interrested:
http://www.artima.com/intv/solidP.html

I'll stop criticising your apps now.
- -- 
Thomas Zander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/k/Z8CojCW6H2z/QRAtWGAJ90ozlaLq04Pphha+d1056wyB6YwgCgzz8R
ZpAU8OHQp0sJff1M+9q0KW4=
=F23E
-----END PGP SIGNATURE-----




reply via email to

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