3 ms·
To make things even worse, we sometimes capitalise these words to emphasise that we're using them in a technical sense, but OR reads as if it's emphasising that
by MaxBarraclough 6y ago
To make things even worse, we sometimes capitalise these words to emphasise that we're using them in a technical sense, but OR reads as if it's emphasising that it's an exclusive 'or'. You can have tea OR coffee is clearly emphasising that it's an XOR operation.
Somewhat related: the Ada language uses and, or, xor for its logical operators, but uses and then and or else for the short-circuit forms. [0] Not a very natural solution in my opinion.
[0] https://en.wikibooks.org/wiki/Ada_Programming/Operators#Short-circuit_control_forms https://en.wikibooks.org/wiki/Ada_Programming/Operators#Shor...
- DaiPlusPlus 6y agoVB.NET also uses “OrElse” and “AndAlso” for short-circuiting. VB6 didn’t support short-circuiting at all.
- MaxBarraclough 6y agoGood example, I'd forgotten about that. On second thought I was mistaken about the example I gave. If someone says You can have tea OR coffee they're really expressing a NAND. You can have at most one out of the two options. Unlike with XOR, you're permitted to have neither. To express XOR, you'd need to say You must have tea or coffee.