The cardinal rule in programming is “Don’t repeat yourself,” or DRY. It says that developers should only implement a particular functionality within a project once. Doing otherwise is bad, because it introduces technical debt and potential inconsistencies.
But it only really applies within the scope of a project. If you move on to something else, it’s inevitable that you’ll write something you’d previously used in different projects, which obviously is hugely inefficient.