Hacker News new | ask | show | jobs
by jandrewrogers 440 days ago
I agree that composition is much better than inheritance for most typical code cases. However, there are cases where inheritance is absolutely the correct model and not having inheritance makes for worse code. I may not use inheritance very often (it rarely makes sense in a systems context) but it is nice to have it when it is unambiguously the right tool for the job.

Most code paradigms exist because there is some code context where they are nearly ideal. Someone invented them to handle that case efficiently and elegantly. If you write diverse software long enough you will come across all of those contexts in real code.

I’m the opposite of a model purist. I have a strong preference for a languages that let you efficiently switch models on a very granular basis as may be useful in the moment.