Re: (TC304.2308) translating logical operators

From: Doug Ewell (
Date: Sat Jun 10 2000 - 02:10:09 EDT

<off-topic still=yes>

Mike Ayers <> wrote:

>>> In any event, relying on the conditional evaluation or non-
>>> evaluation of the second operand in "&&" and "||" is considered
>>> tricky C and best avoided, although there are some cases where it is
>>> indispensible.
>> Humph. Any feature is "tricky" to those who don't understand it.
>> Failing to grasp the Buddha-nature of && and || disqualifies one
>> as a competent C programmer, IMNSHO. Now Duff's device
>> ('s-device.html),
>> *that's* tricky.
> I believe that by "tricky" what was meant is that not all
> compilers properly implement it. At least that's the way I read it,
> however, since I once got bit pretty hard by a C compiler which didn't
> implement short circuit, I would be prone to reading it that way.

No, actually, I did mean "tricky" in the way John inferred, sort of.
I meant that the feature is relatively difficult to spot when re-reading
code that was written possibly a long time ago.

Compilers that don't implement standard features of the language are
beneath contempt.

-Doug Ewell
 Fullerton, California


This archive was generated by hypermail 2.1.2 : Tue Jul 10 2001 - 17:21:03 EDT