[Top][All Lists]

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

Re: Exceptions

From: Norbert Nemec
Subject: Re: Exceptions
Date: Mon, 2 Oct 2000 00:30:16 +0200
User-agent: Mutt/1.0.1i

On Sun, Oct 01, 2000 at 04:14:48PM +0000, Lars Hupfeldt Nielsen wrote:
> Hi,
> I compleetely agree that exception usage in the library is not 
> consistent. In general all errors should be exceptions. There might be  
> a few exceptions to this rule, but there is absolutely no reason that 
> the FILE classes should not raise exceptions. And yes, exceptions 
> should be differentiated by class.

I agree, too: Actually, I realized that the new library does not 
contain those exceptions. I don't even recall, was Keith said about 
that. There was talk about Exceptions once.

After all: Exceptions are the method of choice wherever there are 
errors that occur at runtime that can't possibly caught by the compiler 
(IO-Errors etc) For everything else, there should theoretically be a 
compile-time check. Anyhow, theory does not help much here, since many 
things just cant be checked at compile time. Still pre/post-conditions 
and assertions are a better solution here. If the program were 
hypotetically "bug-free", then these should never catch on under any 
conditions and therefore the checking overhead could be dropped in the 
final compilation.

Still: In any case it is much better to raise an exception than to try 
to cope with the situation in a dirty way or leave it up to the user 
(app-programmer) to check for success by hand...


-- ______________________________________________________
--          To Him, even that machine here has to obey...
-- _________________________________Norbert "Nobbi" Nemec
-- Hindenburgstr. 44  ...  D-91054 Erlangen  ...  Germany
-- eMail: <address@hidden>   Tel: +49-(0)-9131-204180

reply via email to

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