Date: Thu, 4 May 2023 09:42:15 +0200
However, your other listed benefits (except consistency) are still valid: > (Other benefits of ^^ are not requiring explicit casts like "bool(x) ^ bool(y)" (vs "x ^^ y"), and fewer bugs where coders accidentally bitwise compare instead of boolean. But people learn that a single logical operator is bitwise, and a double logical operator is boolean. They then have to remember that ^ doesn't have a bitwise equivalent. ^ is already bitwise. You mean ^ has no logical equivalent? Some logical operators use doubled symbols, some not. && and || specifically stand for the short-circuit evaluation. Otherwise for consistency one would want to introduce !! instead of ! for logical NOT, which would lead to a lot of confusion and faulty programs.
Received on 2023-05-04 07:42:17