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,db5c6b2ef47d4b9e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-21 16:18:38 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!newsfeed.direct.ca!look.ca!newsfeed1.earthlink.net!newsfeed.earthlink.net!newsmaster1.prod.itd.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mail Newsgroups: comp.lang.ada Subject: Re: short-circuit control forms (& 'long names are doom') From: Charles Hixson References: <3B30F836.D700DAA3@raytheon.com> <3B32038D.F1296C79@cadence.com> Organization: Mandala Fluteworks Message-ID: User-Agent: Xnews/4.06.11 Date: Thu, 21 Jun 2001 23:18:37 GMT NNTP-Posting-Host: 198.94.156.19 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 993165517 198.94.156.19 (Thu, 21 Jun 2001 16:18:37 PDT) NNTP-Posting-Date: Thu, 21 Jun 2001 16:18:37 PDT X-Received-Date: Thu, 21 Jun 2001 16:16:29 PDT (newsmaster1.prod.itd.earthlink.net) Xref: archiver1.google.com comp.lang.ada:9013 Date: 2001-06-21T23:18:37+00:00 List-Id: Long Names: I tend to avoid long names, as long as I can come up with a suitable short name. str_ptr has no need to be renamed into String_Pointer. In fact, usually sPtr would be quite clear in context. And compact code that is clear is easier to debug than verbose code that says exactly the same thing. But don't forget the caveat. If the name isn't clear, then it needs to be longer. Or perhaps just totally redesigned. (And when figuring out what is clear, have pity on the maintenance.) Short-Cut Booleans: Sometimes these are mandatory. They rarely do harm in current code. But they may limit the optimization that will be possible in the future. I can quite imagine a compiler that decides that a multi-processor should run the logic tests in parallel, unless they were simple expressions or short-cut forms. And in a few years, this may be significant. OTOH, short-cut forms make the code more deterministic, so perhaps another kind of optimization becomes easier. And they should make correctness proofs easier (fewer paths to examine). I generally only use short-cut booleans where they are needed. -- Charles Hixson Copy software legally, the GNU way! Use GNU software, and legally make and share copies of software. See http://www.gnu.org http://www.redhat.com http://www.linux-mandrake.com http://www.calderasystems.com/ http://www.linuxapps.com/