Is this code correct if foo == 13 false?
foo == 13
if (foo == 13 && ++bar > 42) { ... }
Yes. If the first condition is false, the second will never be evaluated.
See Avoid the side effects of the second expression .