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,a3ca574fc2007430 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Ada and Automotive Industry Date: 1996/11/09 Message-ID: #1/1 X-Deja-AN: 195511540 references: <3280DA96.15FB@hso.link.com> <1996Nov6.210957.3070@ole.cdac.com> <1996Nov8.183051.21638@ole.cdac.com> <561451$rul@lex.zippo.com> organization: New York University newsgroups: comp.lang.ada Date: 1996-11-09T00:00:00+00:00 List-Id: In article <1996Nov8.183051.21638@ole.cdac.com>, james@cdac.com says... >I prefer a language where if I write a statement that looks like >it should be legal it is. Obviously, any illegal statement in any language looks illegal to someone who knows the language well. Equally obviously, it is a design point that any statement which nearly everyone who knows a language quite well thinks looks legal should be legal, and if there are exceptions to this in Ada, there are very few. If you want to talk about a particular case, rather than generalities fine, but the whole point of Ada is to avoid pitfalls of the type you seem to have in mind. Furthermore, I think you don't mean legal here, but something more informal like works. In Ada, we prefer to have an error at compile time, than have a case where something looks OK, but does not work. For example, in C common pitfalls like x = 'a'; if (x = 'a') --- always true if (x == 'a') --- may or may not be true if ("x" == "x") --- generally false are cases of legal C constructs, where presumably the principle you are suggesting applies, these to many people look "ok", but are perhaps not at all "ok", where I am using "ok" deliberately as an informal word. If on the other hand you do really mean legal, and you do really mean that a programmer who does not know much is the arbiter, then, from my experience, nearly every diagnostic in Ada corresonds to something that someone thinks should be legal. I once had a student who appeared with a program that had the diagnostic else .... | >>> error, no matching "if" for this "else" the student was very puzzled and clearly felt this should be legal. When I explained that an IF was needed, then the student responded "Oh, shall I put in an IF somewhere". I assume everyone agrees this is NOT a basis for allowing else with no matching if in a language :-). So we are really talking levels of expertise here. Quite often you see strong opinions from someone who knows language X very well, and is investigating language Y, but does not know Y well yet at all, and has trouble with Y because the X knowledge does not apply. Such a person is not well equipped to make comments on Y yet, and their comments on Y may well have no more validity than an experienced English speaker complaining about "idiot Germans who don't know where the verb should go, and can't understand sentences with the verb in what obviously ought to be a legal position" :-) P.S. I trust that the reference to idiot Germans here is properly understood to reflect idiocy on the part of the mythical English person making this silly comment (not so mythical, I have met people saying essentially exactly that :-)