|
|
|
|
|
by strict9
1197 days ago
|
|
>“Don’t Repeat Yourself” often gets interpreted as “Don’t Copy Paste” or to avoid repeating code within the codebase When I think of the most difficult to understand code I've come across it was probably written by someone who lives and breathes that interpretation of DRY. But it doesn't end with code comprehension. Extreme abstraction and countless files and components also lead to buggy and difficult to maintain code. It's easy to lose understanding of branches and business flow when abstraction exists in the extreme. |
|
The use cases will likely diverge in the future, and if the functions are DRY'd making changes will make introducing bugs from the calling code that you're not working on easy. Eventually the single function will likely have a lot of conditions in it, which is a red flag for this situation.