They are a legacy from a time where many systems couldn't type characters like "!", "{" and "|". These days they should just be avoided. C++17 even removes (not just deprecate) a lot of that old cruft.
It's like "the 80's called; they want their trigraphs back"
You're wrong.
C++17 rewove Trigraph ( ??<, ??( ,...) that's true.
But here we are speaking of the alternative operators (and, or, not, xor, bit_or, ...) of standard ISO C++ created a while ago.
They have been there since C++98, not exactly a recent addition. And they've been in C even longer IIRC (
<iso646.h>)
But they have always been
alternative operators intended to be used when you either cannot input the primary ones or if the source file is using an encoding where the primary ones cause trouble. As far as I understand they have never been intended for use except when you
have to.
I understand that it can be confusing at first but, we are talking about a book. And the goal of it is to learn some new thing to the reader. Maybe it can be the first one.
IMHO a
good book shouldn't teach
bad habits and teaching people to use operator names that almost noone actually use and which will confuse other programmers
is a bad thing.
And for the record, I wouldn't consider this to be more readable:
%:include <iostream>
int main(int argc, char *argv<::>)
<%
if (argc > 1 and argv<:1:> not_eq NULL) <%
std::cout << "Hello, " << argv<:1:> << '\n';
%>
%>
not even if you stick to just 'and' and 'not_eq' in the above
(example from here).
But whatever. I don't want to argue this any further.