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,577df5d4a0e88785 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-12-14 17:08:15 PST Path: supernews.google.com!sn-xit-02!supernews.com!newsfeed.mesh.ad.jp!newsfeed.stanford.edu!headwall.stanford.edu!unlnews.unl.edu!newsfeed.ksu.edu!nntp.ksu.edu!onews.collins.rockwell.com!not-for-mail From: Wayne Magor Newsgroups: comp.lang.ada Subject: Re: Bad coding standards Date: Thu, 14 Dec 2000 18:08:42 -0600 Organization: Rockwell International Message-ID: <3A39610A.890470BF@nowhere.com> References: <3A376D69.A420D711@earthlink.net> <131220001555268634%emery@mitre.org> <91agll$kup$1@nnrp1.deja.com> NNTP-Posting-Host: gatekeeper.collins.rockwell.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.51 [en]C-CCK-MCD (WinNT; U) X-Accept-Language: en Xref: supernews.google.com comp.lang.ada:3151 Date: 2000-12-14T18:08:42-06:00 List-Id: Ken Garlington wrote: > > function "+" (Left, Right: Some_Type) return Some_Type renames > Some_Package."+"; > > function "-" (Left, Right: Some_Type) return Some_Type renames > Some_Package."+"; > This example illustrates why I consider the absolute worst coding standard ever to have been the common Ada83 standard of "the use of the USE clause is prohibited". When you have this ridiculous coding standard, you are almost forced into doing operator renaming, however, this is very dangerous in Ada. Do you see the bug in the above code? The minus operator renames the plus operator. If the code is not tested for proper operation through every single line, it is possible for this to show up in released software (I have seen it). When you consider the applications for which Ada was designed for (and is being used in), it is possible that this stupid coding standard could result in someone's death. When you consider why is was ever adopted, which was simply to make it easier to find items declared in other packages, it seems out of proportion to the (albeit small) risk of catastrophic software failure. I found 5 of these types of errors in an avionics application that prohibited the "use" clause in their coding standards (did not make it on a plane though). After this, they STILL did not change the coding standards... Thank God the "use type" was added to Ada. Before Ada95, I actually REQUIRED people to include a "use" clause instead of using operator renaming because of this very risk. Wayne.