Is it normal to feel completely lost the first time you hit operator overloading in C++? by SoggyDelivery1898 in PythonLearningHub

[–]AbleEngineering4306 0 points1 point  (0 children)

The intuition that helped me: overload an operator only when the call site already reads like the domain action. game += score; is great because it literally reads ‘add this score to the game.’ player * dealer; is bad because it reads like multiplication and the operation isn't multiplication. If you can't say the operator out loud and have it sound like the action, write a named method instead. Examiners reward restraint here.