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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,971aa11c293c3db1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-23 12:41:32 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newshub2.home.com!news.home.com!news.mindspring.net!not-for-mail From: Lao Xiao Hai Newsgroups: comp.lang.ada Subject: Re: Ada The Best Language? Date: Mon, 23 Jul 2001 12:42:25 -0700 Organization: AdaWorks Software Engineering Message-ID: <3B5C7E21.29528B53@ix.netcom.com> References: <5be89e2f.0107170838.c71ad61@posting.google.com> <5be89e2f.0107180235.726d46a8@posting.google.com> <3B55B01A.DAC06D79@icn.siemens.de> <5be89e2f.0107181248.73298c57@posting.google.com> <9j949b$1ujp$1@norfair.nerim.net> Reply-To: richard@adaworks.com NNTP-Posting-Host: 9e.fc.cc.aa Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 23 Jul 2001 19:41:01 GMT X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:10481 Date: 2001-07-23T19:41:01+00:00 List-Id: Bertrand Augereau wrote: > > Ada 95 on the other hand gives you the ability to specify the layout of > > structures with greater precision (in general). This gives it an edge > over C++. > > What do you mean? With Ada it is easier to create platform-independent software designs. As a very simple example, consider a simple integer. How big is an integer in C++? What is its range of values? What is the required size of an integer for your application? What is the required range of values? How do I ensure that one integer is not used where I should be using another in C++? In Ada, I can define my own integer types, each of which can be uniquely identified in a specific scope and with control over direct visibility. Each can have its own range of values. It is wonderfully simple. So simple that one wonders why C++ cannot do it as easily. Even if I choose not to define a unique set of integers with their own ranges, I have one more level of protection in making function and procedure calls: named association. C++ provides no such protection. Consider a C++ function in which there are three parameters all of type int. How does one code a call to ensure that the reader knows the right formal argument is mapped to the right actual argument? Production code in Ada routinely uses named association to prevent stupid errors. One could go on with many more examples, but the real answer is for you to study this subject in some depth on your own so you can understand enough of the subtelties to realize just how much more powerful Ada is, in its rigor, in its reliability, in its syntactic and semantic constructs. C++, as good as it is in many ways, simply does not stand up when one does a detailed comparison of the two languages. The problem is that most people are too busy, too lazy, or too wrapped up in their own biases to do that kind of comparison. Richard Riehle AdaWorks Software Engineering richard@adaworks.com