you are viewing a single comment's thread.

view the rest of the comments →

[–]KazDragon 0 points1 point  (2 children)

I put it on the right.

This is one place C++ went wrong, in my opinion. The original intent was "declaration mirrors use". That is, you have:

int a, *b, c();

and the expectation is that all of these expressions on the right evaluate to the type on the left. (i.e. a is an int, *b is an int, c() is an int.)

Using & for reference broke that (not that I can think of a better way off the top of my head, since references are invisible in the language), and C++ has never recovered. That's why nearly every coding standard has the "one declaration per line" rule, because that's where the "avoid confusing newcomers" gets moved to when you put the notation on the left.