3 ms·
To help figure out when to DRY or leave wet i like to use the rule of 3. Where a piece of code needs to be repeated 3 times before it is DRYd up. You can adju
by jmartrican 4y ago
To help figure out when to DRY or leave wet i like to use the rule of 3. Where a piece of code needs to be repeated 3 times before it is DRYd up. You can adjust this number from 3 to whatever you would like.
What I really like about rule of 3, vs rule of 2, is that it allows more time to go by that may lead to the two pieces of code no longer being identical as requirements change. Which would either remove the need for the abstraction or allow for a more accurate abstraction.
- kitkat_new 4y ago> Which would either remove the need for the abstraction or allow for a more accurate abstraction. or indicate a bug or nothing, because the differences aren't in logic, but e.g. in variable names. ^ perhaps voluntarily or, because happen to not find the duplication, or not search it in the first place. The more time passes by the higher the risk.