info-sather
[Top][All Lists]
Advanced

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

Re: Exceptions


From: Keith Hopper
Subject: Re: Exceptions
Date: Tue, 10 Oct 2000 19:01:26 +1300
User-agent: Pluto/2.02b (RISC-OS/4.02) POPstar/2.02

In article <address@hidden>,
   Norbert Nemec <address@hidden> wrote:
> 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.

     I wrote on exceptions to the news group a couple of days ago - but
they don't appear here (yet?).

     In a nut-shell there are two possible uses of exceptions and exception
handling depending on your philosophy of programming :-

(1)  An exception is only raised when something occurs at run-time which
-prevents- proper termination of some method.

(2)  Every time that something 'unexpected' occurs use an exception.

     When we were discussing this in the Modula-2 standards committee it
was eventually agreed that both models of programming had to be permitted. 
This raised the point as to what the 'standard library' was going to do. 
The solution chosen in M-2 was not my personal favourite since it
introduced a very system-dependent ne Module - system exceptions - which
was at the very low level interface of external interrupts, floating point
indications and a few exceptions to the M-2 numeric model.

     With the potential for a 'universal' event mechanism in the run-time
engine currently being tested here leaves the choice wider open for the
programmer - without sacrificing portability!

              kh

-- 
City Desk
Waikato University
[PGP key available if desired]



reply via email to

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