Path: news.cs.au.dk!not-for-mail From: nospam2159@cs.au.dk (Peter von der =?iso-8859-1?q?Ah=E9?=) Newsgroups: comp.lang.beta Subject: Re: Static vs. dynamic exceptions Date: 20 Jun 2000 16:23:11 +0200 Organization: Computer Science Department of the University of Aarhus Lines: 47 Message-ID: References: <20000619173848.8485.qmail@noatun.mjolner.dk> <8im02p$8s5j$1@xinwen.cs.au.dk> <8infta$9jn7$1@xinwen.cs.au.dk> <394F9765.21D28D31@skynet.be> NNTP-Posting-Host: ufleku.cs.au.dk Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: xinwen.cs.au.dk 961510991 320929 255.255.255.255 (20 Jun 2000 14:23:11 GMT) X-Complaints-To: news@cs.au.dk NNTP-Posting-Date: 20 Jun 2000 14:23:11 GMT X-Attribution: Ahe User-Agent: Gnus/5.0806 (Gnus v5.8.6) Emacs/20.6 Xref: news.cs.au.dk comp.lang.beta:12461 >>>>> "A" == Atle writes: A> Peter von der Ahé wrote: >> Lets say that we have the well known exception pattern and a try >> pattern. Normally when an uncaught/unbound static exception >> occurs we end up with a runtime error. (In my experience most of >> the errors in the Mjolner tools are unbound exceptions.) A> The easiest would be to do it in C, and call it as a C-routine. Do what in C? A> Dynamic exceptions were not left out of Beta because there was any A> problems with the implementation. It was a design choice, Beta A> was designed to use static exceptions instead. I know. But I also know that some design decisions based are on what is most easy to implement :-) (I'm not saying that this is the case with exceptions in BETA - as I do not know) What I argue is that leave/restart are restricted (not really related to exceptions). And that I disagree on the design decision to use static exceptions entirely. Both of these choices makes some implementation issues simpler. A> The philosophy behind this is in the BetaBook.pdf file, chapter A> 16, page 239-253. A> I would argue that putting dynamic exceptions back in would be A> like cutting off the seatbelts of the car - I am now learning to A> like it and live with it. What is so dangerous about dynamic exceptions? Runtime exceptions happens whether you like it or not. Some times the programmer will forget to bind an exception. Consider the example of a flight reservation system considered in Chapter 16 in the BETA book. An even more mission critical system could be the system used by flight controllers (the people in the contol towers in the Airport). Lets say that such a system is created by using some third party software libraries. What if you can't guarantee that *all* possible exceptions in functions in such a library are bound. Then where are your safety belts? I argue that dynamic exceptions provide improved security, as they allow you to catch more runtime errors. -- YMMV