comp.lang.ada
 help / color / mirror / Atom feed
From: Geoff Bull <geoff@research.canon.com.au>
Subject: Re: F9X twister & ADA (was: n-dim'l vectors)
Date: 2000/04/12
Date: 2000-04-12T01:30:28+00:00	[thread overview]
Message-ID: <38F3D1D3.416B3493@research.canon.com.au> (raw)
In-Reply-To: 5jJI4.297$PV.9915@bgtnsc06-news.ops.worldnet.att.net

James Giles wrote:
> Better: each procedure in the call tree should either explicitly handle
> exceptions or *explicitly* pass them to its (immediate) caller.  If neither,
> the program should halt right there.

This is essentially the Java approach, except for the halt feature
(Java doesn't allow the situation to occur where halt would occur).
The problem with this is it makes code maintenace a disaster.
Say you modify a routine and decide it should be changed so it now raises
an exception. You then need to to go fix every place that routine is used
to propagate the exception up to some upper level where you want to handle it.
Handling may be as simple as:
	when others => Put_line ("Internal error: contact vendor);

which to me is a lot better than the program simply halting in the
middle of nowhere. I can't see the advantage of halting immediately,
if you want to halt just don't provided exception handlers.

Apart from its Exception, Java includes a throwable Error, which is
analagous to Ada's exception in that you are not forced to explicitly
deal with it. I find Java's exceptions a pain, often when I catch
them I just raise an Error - I can't halt by calling System.exit()
because I need to catch the Error at the top level and do an
orderly cleanup (e.g. flush files).


>  Mystically skipping over several
> levels of the call tree is messy.

I don't understand what you mean here.

Cheers
Geoff




  parent reply	other threads:[~2000-04-12  0:00 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <8cctts$ujr$1@nnrp1.deja.com>
     [not found] ` <38EA0440.1ECBC158@ncep.noaa.gov>
2000-04-06  0:00   ` F9X twister & ADA (was: n-dim'l vectors) bv
2000-04-06  0:00     ` Richard Maine
2000-04-07  0:00       ` Brian Rogoff
2000-04-08  0:00         ` Dick Hendrickson
2000-04-08  0:00           ` Richard Maine
2000-04-09  0:00             ` Gary Scott
2000-04-09  0:00               ` Richard Maine
2000-04-09  0:00           ` Geoff Bull
2000-04-09  0:00             ` Dick Hendrickson
2000-04-09  0:00               ` Robert Dewar
2000-04-09  0:00                 ` Gordon Sande
2000-04-09  0:00                   ` James Giles
2000-04-10  0:00                 ` tmoran
2000-04-15  0:00                 ` Aidan Skinner
2000-04-17  0:00                   ` Robert I. Eachus
2000-04-16  0:00                 ` Ken Garlington
2000-04-12  0:00               ` Robert I. Eachus
2000-04-10  0:00       ` bv
2000-04-10  0:00         ` James Van Buskirk
2000-04-11  0:00         ` James Giles
2000-04-11  0:00           ` Dale Stanbrough
2000-04-11  0:00             ` James Giles
2000-04-12  0:00               ` Robert A Duff
2000-04-11  0:00           ` Geoff Bull
2000-04-11  0:00             ` James Giles
2000-04-11  0:00               ` Larry Kilgallen
2000-04-11  0:00                 ` James Giles
2000-04-11  0:00                   ` Larry Kilgallen
2000-04-12  0:00                   ` Robert A Duff
2000-04-12  0:00               ` Geoff Bull [this message]
2000-04-12  0:00                 ` James Giles
2000-04-12  0:00                   ` Geoff Bull
2000-04-12  0:00                     ` James Giles
2000-04-12  0:00                       ` Geoff Bull
2000-04-12  0:00                         ` Marin D. Condic
2000-04-12  0:00                           ` James Giles
2000-04-12  0:00                           ` James Giles
2000-04-12  0:00                         ` James Giles
2000-04-13  0:00                           ` Geoff Bull
2000-04-13  0:00                             ` Debugging (was: F9X twister & ADA) James Giles
2000-04-13  0:00                             ` F9X twister & ADA (was: n-dim'l vectors) James Giles
2000-04-14  0:00                               ` Geoff Bull
2000-04-14  0:00           ` bv
2000-04-07  0:00     ` Paul van Delst
2000-04-10  0:00       ` bv
2000-04-07  0:00     ` Erik Edelmann
2000-04-07  0:00       ` Robert Dewar
2000-04-07  0:00         ` Erik Edelmann
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox