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=0.6 required=5.0 tests=BAYES_00,FROM_WORDY autolearn=no 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-15 20:32:30 PST Path: supernews.google.com!sn-xit-02!supernews.com!216.227.56.88.MISMATCH!telocity-west!TELOCITY!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.flash.net!news.flash.net!not-for-mail From: "Ken Garlington" Newsgroups: comp.lang.ada References: <910u3p$v9j$1@nnrp1.deja.com> <3A3445A8.8FC404D5@acm.org> <912ut9$fga$1@nnrp1.deja.com> <3A35AFFF.CA2BA2F9@acm.org> <916gfk$e07$1@nnrp1.deja.com> <916n66$j8c$1@nnrp1.deja.com> <3A376D69.A420D711@earthlink.net> <131220001555268634%emery@mitre.org> <1elo8l3.coy4nxb5upaqN%claveman@inetworld.net> <3A3A8272.30052FAD@mtws.visicom.com> Subject: Re: Bad coding standards X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: Date: Sat, 16 Dec 2000 04:31:48 GMT NNTP-Posting-Host: 216.215.70.23 X-Complaints-To: abuse@flash.net X-Trace: news.flash.net 976941108 216.215.70.23 (Fri, 15 Dec 2000 22:31:48 CST) NNTP-Posting-Date: Fri, 15 Dec 2000 22:31:48 CST Organization: FlashNet Communications, http://www.flash.net Xref: supernews.google.com comp.lang.ada:3197 Date: 2000-12-16T04:31:48+00:00 List-Id: "Wayne Lydecker" wrote in message news:3A3A8272.30052FAD@mtws.visicom.com... : "Charles H. Sampson" wrote: : > : > David Emery wrote: : > : > Actually, I find this an acceptable compromise between my preferred : > style of using the use clause and the usual style of requiring fully : > qualified names. For me, qualifying everything with package names in- : > troduces a tremendous amount of clutter, particularly if the package : > names are long, for the occasional payoff when looking up the name is : > necessary. Using the two- or three-letter rename at least reduces that : > clutter to manageable proportions. If the abbreviations have some dis- : > tinguishing characteristic, such as being all upper case, then your eye : > can skip across them quite easily. Standard, project-wide, renames are : > helpful too, but that might not be practical in monstrous projects that : > have hundreds of packages. : > : > I don't understand the point of the rename in the package specifi- : > cation. : > : > Charlie : > : > -- : > To get my correct email address, replace the "claveman" by : > "csampson" in my fake (anti-spam) address. : : What we do at our company is make renames for each operator that we : need to import. e.g. (pulled randomly from our code): : : function "*"(L:Measurements.Distance_Type; R:Measurements.Distance_Type) : return Measurements.Distance_Type renames Measurements."*"; : : That way we can use the "*" inline without the messy syntax. For : instance, we can write: : : A := B * C; : : instead of: : : A := Measurements."*"(A, B); : : For complex statements, the renames really help. If you're using Ada 95, you should definitely consider "use type" as an alternative. Renaming a set of operators has proven to be so error-prone in my experience, with the error so unlikely to be detected until run-time, that I hope no one uses this routinely! : As far as the TLAs : (three letter acronyms), we used to do that all over our code. Things : got so bad though that we had to use acronyms that didn't even match : what we were trying to rename because it was already taken by another : renamed package. What would be nifty would be to allow a package spec : define its own "approved" renames of the package that other packages : would be allowed to use. I'm sure I'll hear immediately why it's not : a good idea though ;-) : : -- Wayne.