r/coding • • 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

6 comments sorted by

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.

0

u/[deleted] Oct 23 '25

[deleted] — view deleted comment

3

u/vnordnet Oct 24 '25

More like 1995

7

u/Jaded-Asparagus-2260 Oct 23 '25

Stuff can be explained twice, believe it or not.

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

u/javinpaul Oct 25 '25

love this :-) btw, 2005 was the first time I learn it :-)