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,38fc011071df5a27 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-15 22:43:33 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newshub.sdsu.edu!elnk-pas-nf2!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!harp.news.atl.earthlink.net!not-for-mail From: Richard Riehle Newsgroups: comp.lang.ada Subject: Re: Ideas for Ada 200X Date: Sun, 15 Jun 2003 22:45:26 -0700 Organization: AdaWorks Software Engineering Message-ID: <3EED5976.FE24E626@adaworks.com> References: <3EE7CC70.E1FD3A67@adaworks.com> <3EECA772.4B662024@adaworks.com> Reply-To: richard@adaworks.com NNTP-Posting-Host: 3f.bb.69.f6 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 16 Jun 2003 05:43:32 GMT X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:39216 Date: 2003-06-16T05:43:32+00:00 List-Id: Sergey Koshcheyev wrote: > Richard Riehle wrote: > > So, if there is some approach that will ensure that my i += 1 could not be a > > mistake > > for i := 1, that would go a long way toward making it an acceptable construct. > > But is there any approach that can ensure that i := i + 1 could not be > mistaken for i := i - 1? Why was "+" and "-" included in the language > then? :-) There is no syntactic construct that can remedy faulty logic. However, the issue is not faulty logic but mistaken syntax itself. That is why Ada is so strict about so many syntactic constructs that other languages simply pass by as unworthy of notice. >From time to time I hear someone complain about what they see as syntactic sugar in Ada. What they usually fail to understand is that what they see as syntactic sugar is important for the compiler to do its job with the rigor we expect of it. C compilers are notorious for the number of errors that slip through the compilation process. C++, although better, also permits a larger number of errors to pass compilation than Ada. Java imposes some additional checking, but still falls short of Ada. In each case, languages derived from C permit more leeway in what kind of code constructs will pass compilation. This is not evil, but it is contrary to what we want to achieve with Ada. If you want to obtain the benefits of Ada, you must play by the rules of Ada. The most fundamental rule is that each code construct should be as completely validated by the compiler as possible. To accomplish this, Ada deliberately disallows certain combinations of syntax that might seem otherwise intuitive. It enforces the most well-formed set of rules for scope and visibility found in any currently existing language. It defines a set of legalities and illegalities that some programmers find annoying, at first. Ultimately, most programmers, when they come around to accepting the benefits of what the compiler can do for them, will appreciate Ada. To reach a point of appreciation requires that one actually create Ada software. Most of the time, the complaints I encounter are from programmers who have little direct experience with the language. Richard Riehle