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,38fc011071df5a27 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-02 20:01:29 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!wn14feed!worldnet.att.net!204.127.198.204!attbi_feed4!attbi.com!sccrnsc01.POSTED!not-for-mail From: "Steve" Newsgroups: comp.lang.ada References: <6a90b886.0305262344.1d558079@posting.google.com> <3ED41344.7090105@spam.com> <3ED46D81.FF62C34F@0.0> <3ED46E07.4340CABC@0.0> <3ED4F3FD.A0EF7079@alfred-hilscher.de> Subject: Re: Ideas for Ada 200X X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: NNTP-Posting-Host: 12.211.13.75 X-Complaints-To: abuse@attbi.com X-Trace: sccrnsc01 1054609180 12.211.13.75 (Tue, 03 Jun 2003 02:59:40 GMT) NNTP-Posting-Date: Tue, 03 Jun 2003 02:59:40 GMT Organization: AT&T Broadband Date: Tue, 03 Jun 2003 02:59:40 GMT Xref: archiver1.google.com comp.lang.ada:38424 Date: 2003-06-03T02:59:40+00:00 List-Id: "Stephen Leake" wrote in message news:uof1gxx22.fsf@nasa.gov... > 18k11tm001@sneakemail.com (Russ) writes: > > > Stephen Leake wrote in message > > news:... > > > What is wrong with having a style guide that says: > > > > > > "If you have statements like > > > production_total( total_class ).shift( shift_index ) := > > > production_total( total_class ).shift( shift_index ) + count; > > > > > > you must write an appropriate Increment function, and use it instead" > > > > Because it's one hell of a lot easier, not to mention less > > error-prone, to just use +=. That's what Ada is all about. > > But you have only stated your opinion, not given a reason. Hmm, I > guess by "easier", you mean "it's already written for me; I don't have > to write it". That's true, but I object to the qualification "a hell > of a lot"; it's a minor effort. > The reason I prefer Ada over the other choices I have readily available is because it is easier to produce code that works right the first time. A "+=" operation (or equivalent) would improve the chances of producing code for certain expressions right the first time. Over the years I have found myself carefully scanning both sides of an assignment statement similar to the "production_total" example above to make sure the two expressions are identical in order to make sure I am correctly interpreting the meaning of the statement. I am not in love with the "+=" syntax and think another syntax that did the same thing would be just as good. But having you say "write an Add routine" sounds just like hearing a C++ programmer say "you can do array bounds checking in C++". If it isn't easy or automatic, it seldom gets done. Steve (The Duck) > -- > -- Stephe