| > I never understand why operator overloading is said to make things more readable. Because, used properly, it does. > If the meaning of an operator can change wildly with the operands then that's just confusing Yes, irresponsible use of operator overloading makes things confusing. Overloading enables preserving existing semantics with new types that have similar semantic roles, it also enables natural, concise, domain specific notation which may sometimes have different semantics than the standard use (while wild, unpredictable semantic swings hurt readability, humans are naturally quite good at incorporating context into interpretation of symbols/language, and avoiding context sensitivity for naive simplicity does not aid readability.) Verbosity can be quite bad for the ability to quickly grasp the meaning of things. > People seem to confuse "less typing" with "simpler Conciseness (not mere terseness, but clarity and terseness together) greatly aid readability. Verbosity is not zero-cost. |
I've been coding for 40-ish years. I've never found this to be true. Simple expressions are (in my experience) more readable.
I understand it like this: to understand a complex expression you have to unpack it in your head to a simpler version in order to grok it. This is an operation you don't need to do if the expression is in the simpler, more verbose, version in the first place.
This is a known thing in writing, btw - complex sentences are harder to read. If you want your audience to understand you, write more, simpler, sentences.