Posted on July 18, 2017

Duplication is a crime against code. DRY is part of the developer gospel. Even worse a sin however is premature optimization. This tweet really hits home with it:

Michael couldn’t be more right. Instead of trying to project whether you may reuse a block of code or not just wait. Eventually patterns will emerge that show you that you are in fact duplicating code. When this happens it’s time to optimize and you’ll be able to utilize the patterns that emerged to better inform your function or method that you use to reduce this block of code’s footprint.

Happy coding out there!