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,54889de51045a215 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-16 23:22:34 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: 18k11tm001@sneakemail.com (Russ) Newsgroups: comp.lang.ada Subject: Re: += in ada Date: 16 Oct 2003 23:22:34 -0700 Organization: http://groups.google.com Message-ID: References: <49cbf610.0310101231.2358762a@posting.google.com> <1066224357.499523@master.nyc.kbcfp.com> <1066231159.711433@master.nyc.kbcfp.com> <1066311805.222491@master.nyc.kbcfp.com> <3F8F3077.60402@comcast.net> NNTP-Posting-Host: 63.194.87.148 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1066371754 25093 127.0.0.1 (17 Oct 2003 06:22:34 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 17 Oct 2003 06:22:34 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:1054 Date: 2003-10-16T23:22:34-07:00 List-Id: "Robert I. Eachus" wrote in message news:<3F8F3077.60402@comcast.net>... > Hyman Rosen wrote: > > > Hmm. Ada is not my primary language. I guess those would be > > Add(a, To=>b), Subtract(a, From=>b), etc. as others have said. > > Actually I find I often create > > procedure Inc(X: in out Integer); > > I could also create procedure Dec, or add By with a default of 1, etc. > But it just doesn't turn out to be worth the bother. And I think that > is the real problem with Russ's rantings. Some where between 98% and > all of the benefit of the extended operators in C comes from +=, and > that from X += 1; In Ada I write that as Inc(X); and use the same > number of keystrokes. True those people who prefer to write X+=1; in C > do save two characters, but I refuse to worry about it. Two characters? Apparently you forgot about, or don't count, having to write "Inc" in the first place. As I said before, I am not an Ada programmer, so perhaps you can help me understand something. In a large program or software system of your design, approximately how many versions of "Inc" and the like do you have floating around just for basic scalar types? I know that Ada allows, and in fact encourages, the use of specialized types for everything. Do you need to write an "Inc" procedure for each type? Or do you perhaps use generics? Whatever the case, wouldn't it be simpler and cleaner to just use a standard ":+" and let the compiler do it for you? Do you get paid extra for writing code that the compiler can generate all by itself? And how many meetings do you need to inform your programmers of your particular procedure naming conventions when you could avoid all that with a simple standard for the entire Ada world? I read all sorts of discussion on this forum about the need for standard libraries for Ada. Well, why not start at the bottom with standard symbols for common procedures? C++ has the STL, and it also has a standard symbol for incrementing a stupid counter. Every C/C++/Java/Perl/Python programmer in the world is on the same page. But Ada leaves the naming as an excercize for the programmer, and I'm sure there are almost as many conventions as programmers. If that somehow helps "readability", then your definition of "readability" is not the same as mine.