Oct. 27, 2019
11:06 p.m.
On 10/27/19 2:53 PM, Christos Zoulas wrote:
if (lotm_ok & tm_ok
...
if ((lotm_ok && tm_ok)
for clarity? Both lotm_ok and tm_ok are booleans...
Plain AND is simple and goes pretty much all the way back to Boole, if not further. In contrast, short-circuit AND has dicey semantics and is a relative newcomer. Although it's awkward that C uses "&" for both plain and integer-bitwise AND, for booleans I mildly prefer "&" to "&&" when either will do, if only to remind readers of "&&"'s problems.