logoalt Hacker News

carmackfan11/20/20242 repliesview on HN

Your problem was a misuse of inheritance, not encapsulation or interfaces.


Replies

ryaolast Thursday at 1:24 PM

That is exactly what I said you could say:

> You could say that I just did not do it right, but that is the problem. You need to know precisely what the future will want to do it right and that is never possible to know in advance.

Every time inheritance causes a headache, you can call it a misuse of inheritance, but that is only obvious after you have been to the future.

show 1 reply
Sohcahtoa8211/20/2024

Misuse of inheritance is often the biggest generator of criticism of inheritance, sadly.

People use the wrong tool for the job, or use it incorrectly, and then blame the tool. It's like using a hammer to play drums, obliterating the drum set, then ranting against hammers.

show 1 reply