Don’t Repeat Yourself (DRY)
Avoid duplication in code. There should be a single source of truth. There should be one place in our system that deals with the particular problem.
You Ain’t Gonna Need It (YAGNI)
Solve the problems that you know exist, don’t write speculative code. It’s very tempting for developers when writing code, when solving a problem, to add in some extra functionality for something that seems like it might be necessary in the future. But that’s not a great thing to do.Everything you add is code that needs to be maintained, it needs to be tested, it needs to be debugged, and it’s easy for this to lead to feature-creep
Sources:
Comments