-
Abstraction layers: One, two, many

(cc) by piet_musterdIt’s becoming pretty clear to me that when in doubt whether to write an abstraction, the rule is clear: “one, two, many”.
Write something 3 times and you’re breaking the DRY principle. The cost of changing a bit in one place and needing to update the other places too is high.
Abstract something you only use once (in case you want to re-use in the future), and you forgot the “two” in the above rule. The cost for later refactoring is probably not worth the extra load you’ll carry until that day comes. If it comes.
“One, two, many” is usually better than “one, two, three” and “one, many”.
