The logical AND and logical OR operators (&&
, ||
) exhibit "short circuit" operation. That is, the second operand is not evaluated if the result can be deduced solely by evaluating the first operand. ThereforeConsequently, the second operand should not contain side effects sincebecause, if it does, it will is not be apparent whether if the side effects happeneffect occurs.
Non-Compliant Code Example
...