Inheritance is 99.9% of the time (e.g. always...) the wrong decision.
Inheritance, after-all, is one of the strongest forms of coupling you can introduce into your code ;)
There's usually a way to use composition to achieve the same thing.
Composition is 99% of the times a better choice :D
The Template pattern happens a lot more than just 0.1%
Yeah, I kind of wish that hadn’t been such a big part of my formal education.
I only did some CS and so much of it revolved around inheritance in Java that I found myself looking for opportunities to use inheritance in the wrong places.
I feel you there. Been there done that 😋
James, didn't you do a Composition over inheritance post?
I don't think so... but it's something I've had in my head to do someday!
MPJ has a video on it. Very good imo 😀
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.