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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2a993df02f6d82f1 X-Google-Attributes: gid103376,public From: "Steve Doiel" Subject: Re: More questions... Date: 1999/03/08 Message-ID: <36e4a5ff.0@news.pacifier.com>#1/1 X-Deja-AN: 452848439 References: <7bvb4j$lt0$1@remarQ.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 X-Trace: 8 Mar 1999 20:39:27 PST, 216.65.138.135 Newsgroups: comp.lang.ada Date: 1999-03-08T00:00:00+00:00 List-Id: Michael Young wrote in message <7bvb4j$lt0$1@remarQ.com>... >I have two questions about Ada; more will certainly follow. > >1) I've heard it said here that Ada, compared to other languages, is >"reader-friendly" at the expense of being "writer-unfriendly". I >understand the need to be reader friendly. I'm curious why you feel it >is friendlier to read than, say, C++. > For an illustration, point your web browser to: http://www.lucent.com/ideas2/perspectives/bltj/ Select "Current" Then select "A Software Fault Prevention Approach in Coding and Root Cause Analysis". This document is not a contrast of Ada and C, it is an analysis of defects found in a sizable switching system that was implemented in C. The document gives a number specific examples of common coding errors found in the system. In my opinion none of these coding errors would be present if the code were written in Ada. These errors were the result of the tricky syntax in C. It may be easier to read "good" C code than "bad" Ada code. But with my luck (and experience) I am more likely to have to read "bad" C code and "average" Ada code. >2) Robert Dewar stated some time ago that finalize should be used >sparingly because of performance concerns. Is this still true of GNAT >3.11? More broadly, is this a language issue, or a feature specific only >to certain GNAT or other implementation? Destructors in C++ are simply >normal function calls. Are controlled types significantly different from >other types to make this unrealistic? > The use of finalization may add function calls to code that appears to consist of simple assignments. The same is true of C++. While I don't know how Ada and C++ compare when it comes to performance of Finalization versus destructors, both cases add a lot of hidden action to othewise simple looking code. SteveD