this post was submitted on 30 May 2024
386 points (94.3% liked)
Programmer Humor
33584 readers
29 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Operator overloading is adding complexity, making code subtly harder to read. The most important lesson for code is: It should primarily be written to be easy to read by humans because if code is not trash, it will be read way more often than written.
I would argue that there are very definitely cases where operator overloading can make code more clear: Specifically when you are working with some custom data type for which different mathematical operations are well defined.
Yeah, that's a very useful exception.
That's not the most important part of code at all. You can't just had wave complexity away because you don't like it.
Quite the contrary: I like patterns, inheritance and operator overloading as neat concepts. Its just that they are seldom useful in practice.
You and I work in very different fields then