I'm wondering if there is a standard way, if we are pronouncing typographical symbols out loud, for reading the <<
and >>
symbols? This comes up for me when teaching first-time C++ students and discussing/fixing exactly what symbols need to be written in particular places.
The best answer should not be names such as "bitwise shift" or "insertion", because those refer to more specific C++ operators, as opposed to the context-free symbol itself (which is what we want here). In that sense, this question is not the same as questions such as this or this, none of whose answers satisfy this question.
Some comparative examples:
- We can read
#include <iostream>
as "pound include bracket iostream bracket". - We can read
int a, b, c;
as "int a comma b comma c semicolon". - We can read
if (a && b) c = 0;
as "if open parenthesis a double ampersand b close parenthesis c equals zero semicolon".
So an equivalent question would be: How do we similarly read cout << "Hello";
? At the current time in class we are referring to these symbols as "left arrow" and "right arrow", but if there is a more conventional phrasing I would prefer to use that.
Other equivalent ways of stating this question:
- How do we typographically read
<<
? - What is the general name of the symbol
<<
, whether being used for bit-shifts, insertion, or overloaded for something entirely new? - If a student said, "Professor, I don't remember how to make an insertion operator; please tell me what symbol to type", then what is the best verbal response?
- What is the best way to fill in this analogy? "For the multiplication operation we use an asterisk; for the division operation we use a forward-slash; for the insertion operation we use ____."
<
or[
, so I use "open angle bracket" and "open square bracket". – Cantwell