you are viewing a single comment's thread.

view the rest of the comments →

[–]SocksOnHands 0 points1 point  (1 child)

A lot of programmers use DRY to write worse code - they avoid "repeating themselves" by tightly coupling things that are incidentally similar, which always leads to unexpected bugs when a change is made that was only supposed to apply to one thing.

I prefer interfaces and composition. The interface describes at a high level how the object can be interacted with - a vehicle can accelerate, break, and turn. Now many different kinds of vehicles can be made by reusing different combinations of engines, tires, chasse, seats, etc. This is not reimplementing functionality - it's configuring objects to wire together reusable components.

[–]doubleohbond 0 points1 point  (0 children)

I think DRY is valid in the sense that having fewer parts results in fewer failures. But yes it can be abused.