06-22-2026, 08:25 AM
Wanted to add one that I think is underrated: deleting code is one of the best things you can do.
Every line of code is a liability - it has to be read, understood, maintained, and tested. Code that doesn't exist has no bugs. The most impactful refactoring sessions I've had were ones where I removed several hundred lines that were no longer needed or could be replaced with a library call or a simpler approach.
A corollary: the right response to "we might need this later" is almost always to delete it and recreate it if the need actually arises. YAGNI (You Aren't Gonna Need It) is underrated as a principle.
Also: prefer boring code. The cleverest solution is often the hardest to maintain. If you find yourself proud of how clever a piece of code is, that's often a warning sign.
Every line of code is a liability - it has to be read, understood, maintained, and tested. Code that doesn't exist has no bugs. The most impactful refactoring sessions I've had were ones where I removed several hundred lines that were no longer needed or could be replaced with a library call or a simpler approach.
A corollary: the right response to "we might need this later" is almost always to delete it and recreate it if the need actually arises. YAGNI (You Aren't Gonna Need It) is underrated as a principle.
Also: prefer boring code. The cleverest solution is often the hardest to maintain. If you find yourself proud of how clever a piece of code is, that's often a warning sign.
