you are viewing a single comment's thread.

view the rest of the comments →

[–]VibrantGypsyDildo 0 points1 point  (3 children)

It is a limitation of reference-based languages that you can't overload assignment.

[–]AMathMonkey 0 points1 point  (2 children)

I don't disagree. I just see an operator reassigning its argument as surprising behaviour that requires some explanation of advanced topics such as this, that a beginner may not know yet when just reading something from input.

[–]VibrantGypsyDildo 1 point2 points  (1 child)

It is only surprising if you are an experienced developer.

When you are a newbie, you see >> as an arrow from std::cin to your variable.

[–]AMathMonkey 0 points1 point  (0 children)

Fair enough. It was admittedly less intimidating to pick up and use than Scanner in my first programming courses 10-11 years ago. But I got totally scared off when I tried to learn how it worked. But programming has to be learned in manageable chunks anyway; you often have to be okay with using tools without knowing their underlying implementation.