this post was submitted on 01 Aug 2025
156 points (99.4% liked)
Programmer Humor
25425 readers
1301 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
It might be an absolutely adequate method. Imagine that is C++. operator-- is overloaded and controls some machinery. You can't just command capacity = currSize. Process is important.
Yeah, just to say it more clearly: that kind of thing is why lots of people out there insist that operator overloading is a bad idea.
And yeah, it's a C++ thing that mostly doesn't happen in other languages.
Sincerely agree. Explicit is better then implicit, that’s a general engineering axiom.
Instead of overloading and making the next maintainer hunt for overloads, a clearly named function that does the critical steps would make the code immensely more maintainable. C++ is C gone wild.