Mine is that the useState hook is an actual plague on the entire React ecosystem. Regardless of your opinions of React, if you wanna use something then use it right.
Mine is that the useState hook is an actual plague on the entire React ecosystem. Regardless of your opinions of React, if you wanna use something then use it right.
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.