5 ms·
The logic for and/or vs. &&/|| is borrowed directly from Perl. It makes sense once you use them for a bit.
by sabat 16y ago
The logic for and/or vs. &&/|| is borrowed directly from Perl. It makes sense once you use them for a bit.
- _delirium 16y agoMaybe I'm not good at the context-switching between parsing things as operators versus as English, but I find them confusing in Perl except in some very simple idiomatic cases, where they're fine because I read them as boilerplate. The common do_thing or die "error" idiom is perfectly readable, but anything more complex and I start explicitly reasoning about short-circuit semantics. It's possible I have that reaction due to the strong negative consensus about using short-circuiting as control flow in C being hammered into my head at an early age, though.