From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: *** X-Spam-Status: No, score=3.8 required=5.0 tests=BAYES_00,INVALID_MSGID, RATWARE_MS_HASH,RATWARE_OUTLOOK_NONAME autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d4b13594b8779b99 X-Google-Attributes: gid103376,public From: "James S. Rogers" Subject: Re: Improving Ada Exceptions Date: 1997/10/27 Message-ID: <01bce275$c754b680$db11430c@Rogers>#1/1 X-Deja-AN: 285872886 References: <63072n$q6r$1@berlin.infomatch.com> Organization: AT&T WorldNet Services Newsgroups: comp.lang.ada Date: 1997-10-27T00:00:00+00:00 List-Id: 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 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.