Andrew's Digital Garden

Rule of three

The rule of three states that two instances of similar code do not require [[refactoring]], but three instances should be refactored.

Having more examples of how the pattern is used helps us create an appropriate design to remove the duplication. By refactoring too early, we may design code that doesn't meet new requirements easily, or is too constraining.

[[20200307105301-dry]] [[20200307101703-easy-to-change]]

[[principles]]

Rule of three