3 ms·
Short circuiting for logical operators has existed at least since the first C versions in the early '70s. It's maybe not intuitive, it's probably a crummy idea,
by qalmakka 5y ago
Short circuiting for logical operators has existed at least since the first C versions in the early '70s. It's maybe not intuitive, it's probably a crummy idea, but that's how basically everything based on C works (including modern languages like Go and Rust), so there's not that much that can be done about that.
Also, after seeing how weird JavaScript is in comparison, I have to say that C++ definitely isn't the strangest kid in the block when accounting for weirdness and unintuitive behaviours.