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.
Agreed.
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 😀 youtu.be/wfMtDGfHWpA
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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.
Agreed.
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 😀
youtu.be/wfMtDGfHWpA