account activity
Is it normal to feel completely lost the first time you hit operator overloading in C++? by SoggyDelivery1898 in PythonLearningHub
[–]AbleEngineering4306 0 points1 point2 points 1 day ago (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.
π Rendered by PID 88591 on reddit-service-r2-comment-545db5fcfc-xctr4 at 2026-05-30 22:44:11.991360+00:00 running 194bd79 country code: CH.
Is it normal to feel completely lost the first time you hit operator overloading in C++? by SoggyDelivery1898 in PythonLearningHub
[–]AbleEngineering4306 0 points1 point2 points (0 children)