4 ms·
> What would it take to falsify the claim that inheritance is a legacy technique? A demonstration that inheritance is a good technique. Which it is not. It hur
by loup-vaillant 2y ago
> What would it take to falsify the claim that inheritance is a legacy technique?
A demonstration that inheritance is a good technique. Which it is not. It hurts locality of behaviour, and that's bad because it increases the rate of mistakes. There have been studies about this.
- AnimalMuppet 2y agoCan you point us to those studies? Broader question (much broader): Do you know of any place that has a good collection of studies that answer questions like this (questions about CS, language design, and such)?
- loup-vaillant 2y agoThe most reputable resource I know of is Making Software, edited by Andy Oram and Greg Wilson.
- mike_hearn 2y agoLegacy and "good" are different things. I believe I falsified the idea that it's a legacy technique. I actually think it's also a good technique. I also think a lot of other devs agree, they just can't be bothered arguing about it on HN, hence the fact that large high-budget codebases usually seem to use it extensively and aren't switching to some other design. As for studies, I'd be interested to read those, as most studies of developer productivity I've seen aren't that good.
- loup-vaillant 2y agoBy "legacy", I mean "old stuff we thought were good, but is not useful for new projects". Now nothing prevents people from using a useless technique for new projects. Anyway, I don’t care about what we should mean by this and that. What I do care about is whether inheritance is useful or not. And so far, I have seen no evidence that it is anything more than highly situational — meaning, doesn’t have a better alternative for almost everything. The study I recall didn’t measure productivity, it counted bugs. Anyway, I spent enough time on the subject to close the case. Until I stumble upon cogent evidence to the contrary, inheritance is not worth my time. I won’t use it, I will steer my colleagues away from it, and I will quit gigs that use it too heavily.