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.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00, LOTS_OF_MONEY autolearn=no 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-25 07:46:40 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!skynet.be!isdnet!psinet-france!psiuk-f4!psiuk-p4!uknet!psiuk-n!news.pace.co.uk!nh.pace.co.uk!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: short-circuit control forms (& 'long names are doom') Date: Mon, 25 Jun 2001 10:30:36 -0400 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: <9h7hu9$q7u$1@nh.pace.co.uk> References: <3B30F836.D700DAA3@raytheon.com> <3B32038D.F1296C79@cadence.com> <5ee5b646.0106221243.3617111a@posting.google.com> NNTP-Posting-Host: 136.170.200.133 X-Trace: nh.pace.co.uk 993479433 26878 136.170.200.133 (25 Jun 2001 14:30:33 GMT) X-Complaints-To: newsmaster@pace.co.uk NNTP-Posting-Date: 25 Jun 2001 14:30:33 GMT 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 Xref: archiver1.google.com comp.lang.ada:9090 Date: 2001-06-25T14:30:33+00:00 List-Id: I wouldn't exactly call it "disgusting". There are situations in which it makes sense. As was brought up elsewhere, when dealing with tight timing considerations (efficiency being the reason this was brought up in the first place) or high reliability requirements, you may want to force all conditions to be evaluated to avoid timing variations and/or to increase path coverage when testing. I would agree that generally speaking, one would want to avoid side-effects when writing conditional tests. This is the sort of abomination often seen in C programs that makes it difficult to understand & debug the code. (Also one of the reasons you had to "debug" it in the first place, rather than just run it.) But avoidance is not exactly the same as "never". (Example: "if (X = Pseudo_Random_Number (Something)) then...") MDC -- Marin David Condic Senior Software Engineer Pace Micro Technology Americas www.pacemicro.com Enabling the digital revolution e-Mail: marin.condic@pacemicro.com Web: http://www.mcondic.com/ "Robert Dewar" wrote in message news:5ee5b646.0106221243.3617111a@posting.google.com... > "DuckE" wrote in message news:... > We never have a situation where both operands *must* be evaluated, > since this would represent disgusting coding with side effects, so > we do not have a rule that covers this case :-)