Why are the written versions of the logical operators not more widely used? I understand why they exist (to eliminate problems associated with QWERTY keyboards in the early days of programming), but they seem like a syntactic sugar to otherwise "ugly" operators. In this day of auto
and range based for-loops, it seems counter intuitive to use a an "ugly" operator when and
and or
are available.
Surely and
is more intuitive to a beginning C++
student than &&
. Likewise with or
being equivalent to ||
.
I've found this answer, particularly the following blockquote enlightening:
...As for their use: because they are rarely used, using them is often more surprising and confusing than it is helpful. I'm sure if it were normal, they would be much easier to read, but people are so used to && and || anything else just gets distracting.
Which basically says to me "people don't use them so they don't expect them", which seems strange to be because and
(to me, at least) is more intuitive than using &&
.