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,FREEMAIL_FROM autolearn=ham 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-12 12:16:37 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: 18k11tm001@sneakemail.com (Russ) Newsgroups: comp.lang.ada Subject: Re: Ideas for Ada 200X Date: 12 Jun 2003 12:16:37 -0700 Organization: http://groups.google.com/ Message-ID: References: <6a90b886.0305262344.1d558079@posting.google.com> <3EE7CC70.E1FD3A67@adaworks.com> NNTP-Posting-Host: 128.102.146.44 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1055445397 5327 127.0.0.1 (12 Jun 2003 19:16:37 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 12 Jun 2003 19:16:37 GMT Xref: archiver1.google.com comp.lang.ada:39060 Date: 2003-06-12T19:16:37+00:00 List-Id: Richard Riehle wrote in message news:<3EE7CC70.E1FD3A67@adaworks.com>... > Russ wrote: > > > Preben Randhol wrote in message news:... > > > Russ wrote: > > > > Secondly, I'll bet that far more programmers use "+=", when given the > > > > option, than don't. How many C++ or Python programmers do you think > > > > write var1 = var1 + var2 when they can write var1 += var2? Not many > > > > good ones, I'll bet. > > > > > > What about *= and /= ? > > > > I think those get used quite a bit too, though probably not as much as > > += and -=. > > I think it is important to consider this proposed addition to the language > in terms of the underlying goal of Ada. I paraphrase, > > A language design that enables a compiler to detect and report > on the maximum number of errors as early in the development > process as possible. > > The implications of that design goal include a strong model for confirmability, > a high degree of internal consistency, along with a syntax and a semantics that > supports that goal. > > Can this goal be supported with +=, *=, /=, and other variations from the > C family of languages? I submit that it can. Can there be some underlying > benefit from these variations that might improve optimization of code? I > think that is still not proven, even though there cases in C and C++ where > there is a difference. > > Should we do what can be done simply because it can be done? We must > ask ourselves, "At what price?" Will it help make Ada more popular? > Hardly. Will it make it more readable? Not likely. Will it improve support > for the above stated goal? Probably not. > > In the end, the argument boils down to the issue of making one language look > like another, and benefits seem marginal, at best. I have yet to see anyone > cite the benefits for this addition to the language. Then apparently you did not read this entire thread, so let me briefly restate the benefits as I see them. First, the assignment operators provide a more concise and less redundant syntax for common math operations. For example, they allow one to write extra_looooong_variable_name_for_count += 1 rather than extra_looooong_variable_name_for_count := extra_looooong_variable_name_for_count + 1 I happen to think this is better even for shorter variable names. For example, I think count += 1 is cleaner and more elegant than count := count + 1 Why? Because the latter has redundant information. Why repeat the variable name if you don't need to? With +=, if I decide to change the name, I only need to change it in one place on that line, for example. Perhaps I am obsessive minimalist, but the latter construct bothers me. Second, the asigmnment operators provide a more concise and clearer syntax for efficient vector/matrix operations. Why write Add ( Into=>A, From=>B) when I can just write A += B? Note also that these operators are not exclusive to C and C++. They are also available -- and widely used -- in Java, Python, and Perl. Note that C, C++, Java, Python, and Perl are probably the most popular general purpose languages around today. And each of these languages has +=, -=, *=, and /=. So I think it is quite misleading to say that these operators "make one language look like another." What they do is make Ada look like *all* of the five most popular languages around today. If Ada insists on bucking the norm just to be different, I won't be surprised if it continues to fade away, and that would be a shame.