Don’t Prematurely Refactor

Some programmers have the habit of prematurely refactoring code, which often leads to wrong abstractions which requires rewriting anyway as new requirements emerge. As a rule, allow yourself to write the duplicate code at least 3 times before considering abstracting it.

Attempting premature refactoring risks selecting a wrong abstraction, which can result in worse code as new requirements emerge and will eventually need to be refactored again1

Created on: