DEV Community

Discussion on: The Fallacy of DRY

Collapse
 
jeroendedauw profile image
Jeroen De Dauw

Fully agree that it takes experience to build good judgment and that there tend to be exceptions to rules.

I'm being a bit flippant about the code reuse via inheritance topic because I so often see people shoot themselves in the foot. There are times when it is a good choice though, but in my experience they do not occur often.

As to every tool being good for its own job: the thing with inheritance in most languages is that it does two completely different things: code reuse and sub-typing.

Anyway, that really is not what my post is about, and is a topic that takes more than a few short lines to do justice.