comp.lang.ada
 help / color / mirror / Atom feed
From: "James S. Rogers" <jimmaureenrogers@worldnet.att.net>
Subject: Re: Improving Ada Exceptions
Date: 1997/10/27
Date: 1997-10-27T00:00:00+00:00	[thread overview]
Message-ID: <01bce275$c754b680$db11430c@Rogers> (raw)
In-Reply-To: 63072n$q6r$1@berlin.infomatch.com


The biggest problem I have seen with C++ style exceptions is that they can
throw and catch any class.  You must know several things about a C++
exception before you can properly handle it.  First you must know the class
of the exception.  You cannot simply catch an exception, then determine its
class.  You must catch each class explicitly.  This means that using C++
exceptions on a large project can be very difficult.  Each function must
know
the explicit classes of all exceptions it may need to catch.  The result,
in my
experience, is that a development team decides which class to use for all
exceptions.  The most generally useful exception class is a string class.

The result is that practical use of C++ exceptions only uses a subset of
the
possiblities.  That subset is completely subsumed by the package
Ada.Exceptions.  The result is that Ada contains all that is really useful
about
exceptions, even in C++, without the confusion which can result from 
uncontrolled use of classes.  I would no like to see Ada adopt the C++
exception model.  It would be a step away from usefulness towards the
appearance of flexibility.

Jim Rogers
Colorado Springs, Colorado

Ray Blaak <blaak@infomatch.com> wrote in article
<63072n$q6r$1@berlin.infomatch.com>...
> Hello all. I am an Ada fanatic who has just started his first C++
project.
> Being thoroughly ingrained against the evils of C++ I was quite surprised
to
> find it not as bad as I expected. There are many horrible aspects about
it, to
> be sure, but one thing I find very cool is C++'s exception mechanism.
> 
> It is a very powerful thing to be able to throw and catch arbitrary
objects,
> since one can cleanly place whatever appropriate information is relevant
to the
> error. 




  reply	other threads:[~1997-10-27  0:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-10-26  0:00 Improving Ada Exceptions Ray Blaak
1997-10-27  0:00 ` James S. Rogers [this message]
1997-10-27  0:00 ` Chris Morgan
1997-10-27  0:00   ` Tucker Taft
1997-10-27  0:00   ` Alan E & Carmel J Brain
1997-10-27  0:00   ` Larry Kilgallen
1997-10-27  0:00 ` Stephen Leake
1997-10-27  0:00   ` Tom Moran
1997-10-30  0:00 ` Balmacara9
1997-11-03  0:00 ` Richard A. O'Keefe
  -- strict thread matches above, loose matches on Subject: below --
1997-11-03  0:00 Marc Wachowitz
1997-11-08  0:00 ` Wayne Magor
1997-11-10  0:00   ` Samuel T. Harris
replies disabled

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