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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bc1361a952ec75ca X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-30 06:15:10 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeed.gamma.ru!Gamma.RU!aaanet.ru!not-for-mail From: "Gary Lisyansky" Newsgroups: comp.lang.ada Subject: Re: How to make Ada a dominant language Date: Mon, 30 Jul 2001 17:13:20 +0400 Organization: AAA Intersvyaz Message-ID: <9k3mhe$1nuk$1@pa.aaanet.ru> References: <9k36ae$138k$1@pa.aaanet.ru> <3B6557D2.DC2F9F2F@sneakemail.com> NNTP-Posting-Host: 213.59.110.211 X-Trace: pa.aaanet.ru 996498798 57300 213.59.110.211 (30 Jul 2001 13:13:18 GMT) X-Complaints-To: usenet@news.aaanet.ru NNTP-Posting-Date: 30 Jul 2001 13:13:18 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Xref: archiver1.google.com comp.lang.ada:10738 Date: 2001-07-30T13:13:18+00:00 List-Id: "Russ Paielli" <18k11tm001@sneakemail.com> wrote in message news:3B6557D2.DC2F9F2F@sneakemail.com... > Gary Lisyansky wrote: > > Ada is known to favour code reader over the code writer, while Python tends > > to be a typical "write only" language. > > Sorry, but that's just baloney. You must be confusing Python with Perl. It's not a baloney at all. To list but some elegant features, absence of parameter type information makes the source code very difficult to read. Mandatory placement of statements in lines and indentation rule make the thing even worse to read (a li'l hint: some procedures and nested compound statements may not fit into the height of the scrollable viewport of your editor:-)). Given variables are typeless, even the world's most advanced IDE won't give you a chance to understand what "someObject.doSomething" really means and find the definition of doSomething(), for instance. > > > > > > > Here are the syntax changes I propose: > > > > > > 1. Eliminate the "end" keyword and make the indentation structure an > > > inherent part of the syntax, as in Python. > > > > This makes whitespace the part of the language syntax. In practice, it's not > > convenient, and adds *extremely nasty* tab/space problems. In common, it's a > > bug generator. > > Whitespace is already part of the language syntax. Don't believe me? > Take all the whitespace out of your programs and see if they still work. Whitespace in well- designed languages is used as separator only. In Python and other indentation- based languages it is effectively a keyword, and a one without well- defined meaning. "Four whitespaces" may, depending on the situation mean just the next statement in a block, or the end of a compound statement, or may be used to distinguish between a method of a class and a non- component function. What's that, programming using innuendoes? Add here bugs like mis- indented statement that may keep the code still formally valid but screwed up logically. > > > > > > > 2. Eliminate the requirement for a semicolon after each executable > > > statement, but allow semicolons for combining multiple statements on a > > > line, as in Python. > > > > "Physical" line is not an element of Ada syntax. Writing statements in one > > line or several lines is purely the question of style which allows for more > > flexibility and readability. Changing this doesn't make any sense. In fact, > > suggestions 1 and 2 are in contradiction to the very idea of a free- form > > language. > > If 99% of executable statements are on one line, it is ridiculous to > clutter every line with a semicolon. 99 /= 100. And, the ability to freely use whitespace to format the source code for easy readability is quite valuable. Using ":" or ";" *inside* the multiline statement is much weirder, it's used (except Python) mostly for compatibility with advanced languages frequently called "street Basic". > > > > > > > 3. Use "=" rather than ":=" for assignment, as in Python. (Use "==" > > > for equality testing if necessary to avoid confusion with assignment.) > > > > > > 4. Use "=" instead of "=>" for passing arguments by named association, > > > as in Python. > > > > > > 5. Reverse the backward declaration syntax. For example, use "integer: > > > count" instead of "count: integer", or use "integer in: count" instead > > > of "count: in integer". > > > > Exactly the same amount of typing. Only the reverse order of words that > > seems to be less readable. > > The point is not the amount of typing. And I'll bet that the vast > majority of non-Ada-programmers think it is more, not less, readable. The infamous if (a = b) is so widespread an error in C++ that many compilers issue a warning when encounter this perfectly legal construct. It's because even years of C++ programming can't erase natural human habit to use "=" as equality operator, and not "==". > > Russ Gary