From: Charles Hixson <charleshixson@earthling.net>
Subject: Re: short-circuit control forms (& 'long names are doom')
Date: Thu, 21 Jun 2001 23:18:37 GMT
Date: 2001-06-21T23:18:37+00:00 [thread overview]
Message-ID: <Xns90C7A5EA1B78Dcharleshixsonearthli@207.217.77.21> (raw)
In-Reply-To: 3B32038D.F1296C79@cadence.com
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/
next prev parent reply other threads:[~2001-06-21 23:18 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 [this message]
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
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox