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,60e2922351e0e780 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-05 11:08:02 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: 18k11tm001@sneakemail.com (Russ) Newsgroups: comp.lang.ada Subject: Re: Clause "with and use" Date: 5 Nov 2003 11:08:02 -0800 Organization: http://groups.google.com Message-ID: References: <3FA2CDCB.500F4AF0@fakeaddress.nil> <3FA3B412.AF3BEB96@fakeaddress.nil> <3FA50083.10709@noplace.com> <3FA777E9.4030605@noplace.com> NNTP-Posting-Host: 63.194.87.148 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1068059282 4330 127.0.0.1 (5 Nov 2003 19:08:02 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 5 Nov 2003 19:08:02 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:2100 Date: 2003-11-05T11:08:02-08:00 List-Id: "Warren W. Gay VE3WWG" wrote in message news:... > I personally think it is necessary to keep encouraging > the programmers to think about more than their own > convenience. This is what much of the += ballyhoo is > all about. >From my perspective, that is simply your persistent misunderstanding of the "+= ballyhoo". I have given several good reasons in favor of "+=" (or ":+"). Note that "saving keystrokes" is not one of them, despite the persistent bleatings to the contrary. And what is wrong with "programmer convenience," when there is no downside? Do you think "programmer inconvenience" is an inherent virtue? Here are the reasons I have given in favor of "+=": 1. "+=" (":+") relieves the *reader* of the code of the task of verifying that the twice-named variable is indeed the same variable repeated twice. And it does so without the cumbersome mechanism of renaming and explicity creating a new scope. 2. "+=" (":+") provides a *standard* symbol for common operations on scalar types. Yes, that is a "programmer convenience" because it relieves the programmer of the make-work task of defining (or instantiating) his own "Inc" operator for many different types. It also reduces the possibility that the programmer could err in doing something that the compiler could do for him. I don't know about you, but I find that good compilers are usually less error-prone than me. 3. "+=" (":+") provides a *standard* symbol for efficient vector/matrix (and other) operations, thus preventing a proliferation of user-named procedures such as Add ( A, To=> B ); -- or MatrixAdd ( source=>A, destination=>B ); -- or MatrixAddition ( from=>A, inplace=>B ); -- etc., etc. ... By the way, if a C/C++ programmer writes x = x + 2; in lieu of x += 2, chances are he is not a top-notch programmer. But Ada forces such bad style, and that's bad style itself.