Does Ada have multiple inheritance?
(From rosen@enst.fr)
YES, with a mechanism that is slightly different from what is found in other languages. It's normal: since Ada is the most recent object oriented language, it has learned from previous experience. More specifically, the chosen mechanism is safer, especially in presence of repeated inheritance.Other "ammunition" is available below, and of course also on the Ada WWW Server.You may find that this mechanism requires a bit more typing, but this is consistent with Ada's philosophy that ease of reading and safety should prevail over ease of writing.
Date: Fri, 9 Dec 94 14:35:38 EST From: conn@lear.mitre.org (Richard L. Conn) To: team_ada@acm.org Subject: Grady's article in Nov 94 IEEE SoftwareGrady Booch has written an excellent overview article in the Nov 94 issue of IEEE Software on object-oriented concepts and issues. I thought you might like to see some of his words:
" Although C++ and Smalltalk may be winning the minds of more developers than any other language, this is not to say that all other object- oriented [he said there were over 100 earlier in the article] programming languages are inconsequential. In the category of most elegant, I place Eiffel, which has a vocal following, especially in Europe. In the most- trusted-for-complex-systems category, I place Ada. Many of the world's next-generation air-traffic-control systems are being written in Ada, for example (and as a frequent flyer, I'm very comfortable with that fact). Ada9x brings Ada fully into the object-oriented world, with the addition of inheritance with polymorphism. In the most flexible category, I place CLOS. ...Rick
That being said, it is fairly clear that your children and your children's children will be maintaining some of the C++ and Smalltalk code that some of you are writing today. A frightening proposition, indeed, but it shows that even in an object-oriented world, some things do not change."
From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) Newsgroups: comp.lang.ada Subject: Why I like Ada Date: 2 Dec 1994 20:44:35 +1100 Organization: Comp Sci, RMIT, Melbourne, Australia Summary: really a whinge about a C program...When I printed the master copies of my exams for our recently past exams, they were shifted down on the page. I hadn't changed my (LaTeX) formats. I didn't know whether to blame LaTeX, the a4wide.sty file (which was now mysteriously aliased to the a4.sty file for some reason), something else in the TeX software proper, dvitops, the laserprinter it was sent to, or some configuration file totally beyond my ken. (I've since been told it is most likely the latter, but our technical support group having been downsized to the point where there isn't really enough worker time left to read problem reports, let alone do anything about them, well, I guess I'll have to live with the problem for a while.) One thing I thought of doing was to try another formatter.
There's another formatter which I had long wanted an excuse to try. It has a lot of nice ideas. The design has been published in the technical literature; the project in question has been running for ~10 years; it's actively supported; there's a mailing list for help; and if I FTPed it the sources would be under *my* control so that nobody else would tamper with key files.
Of course, the sources are written in C. 43 *.c files. One .h file with everything in it. 25 000+ lines. Not a very big program. So I edit the Makefile to tell it where I want things put, and make one change that had not occurred to the author: I added "-Wall" to the gcc command line. OW! After about two weeks of spare time tweaking (putting 'static' here 'void' there, a prototype in the other place, really minor stuff) I finally have it to the point where there are about 300 lines of output from Lint (that is a huge improvement, let me tell you).
Fairly obvious point number 1: about 100 of those lines warn that the ANSI C rules for mixed signed/unsigned arithmetic are DIFFERENT from the traditional K&R/pcc/UNIX rules for mixed signed/unsigned arithmetic, and that this may have affected line so-and-so. I have no idea how many of the warnings are genuine, BUT THE AUTHOR WASN'T SEEING ANY OF THEM because he wasn't using gcc -Wall or lint.
Interestingly enough, while I was composing this message I decided to try to do something about those 100 lines. It turns out that *most* of them are benign (lint warning that "x > 0" is suspicious) but lurking amongst them are
p = ...
while (...) {
x = ...
...
}
... use x ...
which is ok *IF* the loop executes at least one time, typically if the
doubly linked list it traverses is non-empty. As it happens, the code
is full of things that only make sense for non-empty lists, and rather
sparing of comments or assertions that would make me confident. Lint
and gcc haven't found uninitialised variables, but they _have_ found a
maintenance problem.
When I got most of the warnings caused by sloppy style out of the way, I found that a number of serious and potentially serious problems were present, and gcc -Wall and lint found them.
-- "The complex-type shall be a simple-type." ISO 10206:1991 (Extended Pascal) Richard A. O'Keefe; http://www.cs.rmit.edu.au/~ok; RMIT Comp.Sci.
From: rosen@enst.fr (Jean-Pierre Rosen)
Newsgroups: comp.lang.ada
Subject: Astree project
Date: 10 Oct 1994 08:54:41 +0100
Organization: Ecole Nationale Superieure des Telecommunications,
Paris France
The Astree project is a huge French project aiming at controlling in
real time the location of all trains in France, and later to be
connected to a European wide system.
There was initially a debate about using Ada, but eventually it was decided to develop an initial prototype version in C.
After developping 300 000 lines of C code, the prototype was found so unmaintainable that the decision was taken to throw everything away and to start over - in Ada.
Ada fans are requested to refrain from smiling until the project is (succesfully) completed. :-)
From: Magnus.Kempe@di.epfl.ch (Magnus Kempe) Newsgroups: comp.lang.ada Subject: Re: Recommendations on software RFP/RFQs??? Date: 23 Sep 1994 08:34:00 GMT Organization: Ecole Polytechnique Federale de LausanneMatt Whiting writes:
: My organization has decided to standardize on C and C++ ...How a company can decide to *standardize* on C++ --a language which is far from being standardized-- is really beyond comprehension. (I mean "beyond" on a cosmic scale.)
[...]
Ignorance can only be defeated by education. The Ada awareness campaign should also target the companies who want to "standardize". By the end of this year,
Ada WILL BE THE FIRST STANDARDIZED OBJECT-ORIENTED LANGUAGEwith strong typing, exceptions, generics, and tasking since 1983. There are hundreds of validated Ada compilers, for practically every platform one can dream of, and Ada vendors are already introducing the tasking, real-time, and OO constructs into their compilers.
C++ may become a standard by 1996, but it is unlikely that Borland and Microsoft will ever conform *entirely* to it; that would be out of character for these companies.
-- Magnus Kempe "I know not what course others may take, but as for me, Magnus.Kempe@di.epfl.ch Give me Liberty... or give me Death!" -- Patrick Henry
From: eachus@spectre.mitre.org (Robert I. Eachus) Newsgroups: comp.lang.ada Subject: Re: Ada ad in Embedded Systems Programming stinks Date: 6 Sep 94 09:40:18 Organization: The Mitre Corp., Bedford, MA.In article <34g5v3INN6q2@phage.cshl.org> pjm@isis.cshl.org (Pat Monardo) writes:
Now I understand why languages are religions. Listening to an Ada person describe C is like listening to a Christian describe Hinduism. Remember, C is a language, not an environment. If want to impose discipline on your C code, then find a tool that supports your religion. If you allow warnings to stay in your code, then you are indeed in need of disciplining, try C++ :)
pragma SERMON(ON);Ada is NOT the religion, software engineering is the religion. Most Ada avocates, myself included, read, understand, and even use C where appropriate. We do not treat C programmers as heretics, we regard those who speak only C illiterate. Why? Because those who only speak George Orwell's Newspeak, or for that matter double plus C, are unable to understand the problems the only language they know forced them to live with.
If someone tried to sell you a car with no brakes, with the explanation that drivers with good eyesight and coordination didn't often use them, you might be tempted to do physical harm to the seller. But if yhe only automobiles on the market had no brakes, no emergency flashers, no seatbelts, and no airbags, you might not be willing to "pay the extra cost" for this unwanted feature in a new car. Those who want to use the highways, but find the risk from other drivers in brakeless cars unacceptable, just throw up their hands when the drivers who have never learned to use brakes explain why they don't want them.
Lest this seem too farfetched, read the history of George Westinghouse and his "automatic" brakes for railroad cars. (Yes, once upon a time the job of the railroad brakeman was to go from car to car manually adjusting the brakes.) Or better yet, the fight by WWI fighter pilots to be permitted to carry parachutes!
If you accept the need for tools which detect and prevent major debugging problems before they occur, then you can begin to understand why software engineers are such Ada advocates. For example, while C++ designers are just beginning to understand elaboration issues, it has been at least a year since I had to help an Ada programmer who had elaboration order problems. Ada users quickly learn which structures can cause elaboration issues, use those structures only where necessary, and track the elaboration order when it may be a problem. Not painting yourself into a corner early in the design process can save months later in the development process, usually during integration.
Passing an object instead of a pointer to it (the earlier example) is a difference between Ada and C. But it is the tip of the iceburg which most C programmers never see, even after their ship (or project) sinks beneath the waves. I will continue to react rudely to any C programmer who tells me why he doesn't need compile time checking, just as I would to a driver explaining why his car has no brakes. I have had to deal with too many bodies from the (software development) highway to do otherwise.
pragma SERMON(OFF);
--
Robert I. Eachus
with Standard_Disclaimer;
use Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...
Extracted from: ftp://ajpo.sei.cmu.edu/public/news/adatoday.txt DATELINE: July 13, 1994Safety Critical Software Systems refers to those systems that are critical to human life. Many industries, including transportation, nuclear energy, and medicine are in the process of setting specific standards for the development, testing, and certification of safety critical software. An area of key importance is the software language used as the basis for the final installed system. Standards specify that the language must be well-defined, have validated tools, enable modular programming, have strong checking properties and be clearly readable. Of all the programming languages available today, only Ada provides an appropriate baseline for safety critical software.
Ada has numerous properties which make it a natural choice for the development of safety critical systems.
[Source: "Safety Critical Software - The Ada Solution." Alsys world Dialogue, Spring 1994, Vol.8, Number 1.]
Newsgroups: comp.lang.ada From: breland@photon.mcc.com (Mark A. Breland) Subject: Re: Ada Success Stories Date: Wed, 13 Jul 1994 22:21:30 GMTSoftware Magazine's Top 100 software vendors list just came out (they're up to $19.5B in sales for 1993, BTW). Guess what was found smack dab in the middle of that article? A full page ad placed by the Ada Software Alliance...text to follow:
"Those who swear by their systems choose their language carefully."
[nice, robotic auto manufacturing picture here (lotsa sparks flying)]
"In today's highly competitive commercial marketplace, system errors can be catastrophic. That's one reason why Ada has become the language of choice for developers of large, complex applications worldwide."
"Ada has the tools to find mistakes. The language;s inherent readability ensures that an error is easily understood, and is therefore quickly rectified. What's more, the compilers will stop, rather than allow incorrect code to go through. And program parts that you know to function correctly can safely be re-used. Think of the money you save by catching errors early, fixing them easily, and re-using what you know works."
"For a free kit containing a catalog of industry resources, some information on commercial Ada usage that may surprise you, and a summary of how Ada is evolving for the future, call the Ada Software Alliance at 800 380-4ADA."
"Ada. The language for a fail-safe world."
Mention is also made of TRI-Ada '94 in a small blurb at the bottom.
Now what better way to get the attention of these top 100 software purveyors than to stick an ad like this right in the middle of their shining, publicized glory?
Mark A. Breland Microelectronics and Computer Technology Corporation (MCC) Information Systems Division | voice: (512) 338-3509 3500 West Balcones Center Drive | FAX: (512) 338-3900 Austin, Texas 78759-6509 USA NB#51 | internet: breland@mcc.com
Last update: 97/02/25.
Dirk Craeynest