Get someone to review your code, don’t have them spend too long, 5 minutes is enough, but have them review it often. Known unknowns are easy to spot and fix when you test your code, but what about unknown unknowns?
You might be making obvious mistakes and not realizing it. By having someone skim-read your code from time to time, you hold yourself accountable to write clean, commented code, knowing someone will be looking, and if you make a mistake then it will be noticed quickly so that you don’t get into bad habits. Nobody wants to realize they have made the same mistake lots of times throughout a project, then have to go through to refactor or re-write code at the end.
Contributor: Andrew Ward from andrewleeward.com