Home Segments Index Top Previous Next

184: Sidetrip

Note, however, that many programmers object to the use of && and || operators to allow or block evaluation. They argue that, when an && or || operator is included in an expression, anyone who looks at the expression—other than the original programmer—naturally expects the value produced by the expression to be used. If the value is not used, the person who looks at the program might wonder whether the original programmer left out a portion of the program unintentionally.

Accordingly, some C compilers complain about using an && or || expression whenever the value of the expression is not actually put to use.