r/coding • u/javinpaul • Oct 22 '25
Stop Using Inheritance for Code Reuse — Favor Composition Over Inheritance
https://javarevisited.substack.com/p/stop-using-inheritance-for-code-reuse
0
Upvotes
0
Oct 23 '25
[deleted]
3
7
1
u/lifelite Oct 25 '25
It’s still a good reminder as even experienced devs fall into bad habits working on shitty codebases lol
0
3
u/AvidCoco Oct 24 '25
Both is good.
Inheritance has lots of benefits, composition has lots of benefits.
Stop telling me I must use one thing or another and just let me decide for myself when to use each.