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-13 12:55:41 PST Path: supernews.google.com!sn-xit-02!sn-xit-03!supernews.com!cyclone-sf.pbi.net!63.208.208.143!feed2.onemain.com!feed1.onemain.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.mathworks.com!blanket.mitre.org!news.mitre.org!emery From: David Emery Newsgroups: comp.lang.ada Subject: Re: Bad coding standards Date: Wed, 13 Dec 2000 15:55:26 -0500 Organization: The MITRE Corporation Message-ID: <131220001555268634%emery@mitre.org> References: <3A376D69.A420D711@earthlink.net> NNTP-Posting-Host: gargoyle.mitre.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: top.mitre.org 976740939 14330 128.29.123.65 (13 Dec 2000 20:55:39 GMT) X-Complaints-To: usenet@news.mitre.org NNTP-Posting-Date: 13 Dec 2000 20:55:39 GMT User-Agent: YA-NewsWatcher/5.0.0 Xref: supernews.google.com comp.lang.ada:3095 Date: 2000-12-13T20:55:39+00:00 List-Id: For a while, I collected coding standards as a hobby. I've seen some dumb ideas, but here's my nomination for worst idea: package Long_Descriptive_Name is package LDN renames Long_Descriptive_Name type T is ... end Long_Descriptive_Name; with Long_Descriptive_Name; package A_Client_Package is package LDN renames Long_Descriptive_Name; procedure Proc (Param : LDN.T)... end A_Client_Package; In this style, the existence and use of the rename was not an option, but was mandatory. Furthermore, there were no rules for how a rename would be formed. In some cases, the abbreviation related to some previous name for the package. I once sent out a "test" with 10 abbreviations for common packages, asking how many people recognized the renames. The best score was 8 out of 10, and the average was about 5. In my example, things don't look so bad. But when you're buried in the middle of the code, and you see things like Obj : Abbr.Object; ABC.Munge (XYZ.Func (Obj), QRS.Enum, ADX.Scalar); you rapidly lose the redability of Ada, as you have to go find the damn renames clause to remember what ABC and QRS were. As one of the first "maintenance" programmers (I rewrote one unit twice, the first for time and the second for space...), I found this to be incredibly hard to read. My first action was to replace the abreviations with the long names, so I could figure out what was actually going on. And after I left, they paid someone to go through my code, replacing my Nice_Long_Name qualified expressions with their standard NLN renames. Ugh! dave