9 hours ago,Adam​Speight2008 wrote
*snip*
The boolean value could be result of a side effecting function. Or the evaluate of each takes a while. Why even evaluate the second argument if you don't need to?
That was my point exactly. By using & instead of &&, either you are wasting time, or your code relies on obscure side-effects. Neither is desirable, unless you are dealing with...
6 hours ago,blowdart wrote
*snip*
Timing attacks on security functions
Some functions should never exit early on failure - comparing hash values for example.
This is a legitimate case where short-circuiting is undesirable, and that can also happen elsewhere (for instance, time sensitive code in firmware). Yet, in these cases I prefer not to rely on a subtle difference and express my intent more clearly. Maintenance happens.