comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <marin.condic.auntie.spam@pacemicro.com>
Subject: Re: short-circuit control forms (& 'long names are doom')
Date: Mon, 25 Jun 2001 10:30:36 -0400
Date: 2001-06-25T14:30:33+00:00	[thread overview]
Message-ID: <9h7hu9$q7u$1@nh.pace.co.uk> (raw)
In-Reply-To: 5ee5b646.0106221243.3617111a@posting.google.com

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" <dewar@gnat.com> wrote in message
news:5ee5b646.0106221243.3617111a@posting.google.com...
> "DuckE" <nospam_steved94@home.com> wrote in message
news:<QGyY6.222270$p33.4459972@news1.sttls1.wa.home.com>...
> 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 :-)





      parent reply	other threads:[~2001-06-25 14:30 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-20 19:23 short-circuit control forms James A. Krzyzanowski
2001-06-20 20:15 ` Ted Dennison
2001-06-20 20:47 ` Marin David Condic
2001-06-20 22:23 ` Jeffrey Carter
2001-06-21  0:45   ` Al Christians
2001-06-21 15:06     ` Wes Groleau
2001-06-21 15:46       ` Al Christians
2001-06-21 18:28         ` Wes Groleau
2001-06-21 18:51         ` Marin David Condic
2001-06-22 12:17           ` Marc A. Criley
2001-06-22 14:55             ` Marin David Condic
2001-06-22 20:58   ` Robert Dewar
2001-06-22 21:49     ` Ted Dennison
2001-06-22 22:58     ` Jeffrey Carter
2001-06-23  0:38       ` Larry Kilgallen
2001-06-23 17:34       ` Simon Wright
2001-06-26 15:48       ` Wes Groleau
2001-06-25 17:00     ` Wes Groleau
2001-06-21  0:13 ` Mark Lundquist
2001-06-21  0:55   ` Al Christians
2001-06-21 12:39   ` Larry Kilgallen
2001-06-21 15:02   ` Wes Groleau
2001-06-21 14:24 ` short-circuit control forms (& 'long names are doom') Paul Graham
2001-06-21 17:20   ` Warren W. Gay VE3WWG
2001-06-21 18:32     ` Wes Groleau
2001-06-21 23:18   ` Charles Hixson
2001-06-22  1:01     ` Larry Kilgallen
2001-06-22  3:10     ` DuckE
2001-06-22 15:46       ` Wes Groleau
2001-06-22 19:02         ` Ted Dennison
2001-06-22 19:16         ` Ted Dennison
2001-06-22 20:53         ` Robert Dewar
2001-06-22 20:43       ` Robert Dewar
2001-06-22 22:34         ` Jerry Petrey
2001-06-25 14:30         ` Marin David Condic [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox