this post was submitted on 25 Oct 2026
373 points (95.2% liked)
Programmer Humor
33844 readers
2101 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
- If the mod doesn't find it funny, you're banned. Ha-ha!... For real: do not use the community for "statements". There are other places for such content. Keep it chill and funny.
founded 3 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Why does it make zero sense in C++?
edit: simplified example of what i mean
vs
B and C can't share any other attributes without duplication of code. There's also no strict enforcement of inheritance.
It was a simplified example.
even if you use virtual attributes aren't inherited.
If you ment members instead of attributes this is unrelated to virtual:
Now the member is shared and it works fine and there is no virtual.
True, but neither is there when just using virtual:
This compiles fine if final is not added.
Not that its an issue as reflection has solved this problem:
Now you get the strict enforcement of inheritance and no virtual.
LOL. That mess is somehow better?
One utility function somewhere vs runtime polymorphism everywhere?
Yes.
You just reinvented polymorphism with extra jank.
How is it jank to put one utility function in a file somewhere you never need to look at again?
That is if you even want to do the assert since if the type doesn't have the method it won't compile in the calling function anyway but since you mentioned the strict check it's fully possible.
And why isn't it jank to write virtual, final, and override everywhere and have the entire codebase infested with vtables.