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,db5c6b2ef47d4b9e,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-20 12:23:38 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.mathworks.com!cyclone.swbell.net!bos-service1.ext.raytheon.com!bos-service2.ext.raytheon.com.POSTED!not-for-mail Message-ID: <3B30F836.D700DAA3@raytheon.com> From: "James A. Krzyzanowski" X-Mailer: Mozilla 4.75 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: short-circuit control forms Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Wed, 20 Jun 2001 14:23:34 -0500 NNTP-Posting-Host: 151.168.135.75 X-Complaints-To: news@ext.ray.com X-Trace: bos-service2.ext.raytheon.com 993065017 151.168.135.75 (Wed, 20 Jun 2001 15:23:37 EDT) NNTP-Posting-Date: Wed, 20 Jun 2001 15:23:37 EDT Organization: Raytheon Company Xref: archiver1.google.com comp.lang.ada:8933 Date: 2001-06-20T14:23:34-05:00 List-Id: Looking for expert opinions... We have a company standard which states: "standard => Use short-circuit control forms to specify the order of conditions when the failure of one condition means that the other condition will raise an exception. guideline => Avoid short-circuit control forms otherwise." Our software engineers believe that using short-circuit control forms will make our software more efficient (speed-wise). So, they have been replacing every "and" with "and then" and every "or" with "or else". We use Rational Apex and a Rational Representative sent correspondence basically saying that their compiler will NOT optimize plain "and" and "or" to behave as though the best "and then" and "or else" order has been specified. The reason for our standard on this topic is because we expected the compiler to be smarter than the software engineer when it comes to specifying an order of conditions. This is also consistent with Ada 95 Quality and Style: Guidelines for Professional Programmers. If using "and then" and "or else" will make our software quicker, and then the compiler doesn't optimize any better anyway, does anybody have a good reason why we should NOT use short-circuit control forms? -- --------------------------------------------------------------------------- James A. Krzyzanowski - Staff Software Engineer - AFATDS %c% Raytheon Systems Company * Fort Wayne, IN 46808 * (219) 429-6446 cus mailto:James_A_Krzyzanowski@raytheon.com %s% ---------------------------------------------------------------------------