We do a couple of things at hashnode to minimize bugs,
- Test Everything - Most of the time, bugs occur when you merge a new feature with the existing code. In those situations, you will not know whether there is a bug until somebody in your team notices it or worse users notice it in the production environment.
- Write Documentation - Unless it is your personal project, the codebase will be used by multiple people on your team. Writing comments in the code helps reduce bugs when somebody else works on or uses a piece of code which you wrote.
- Linting - Linting not only normalizes how your code looks throughout the codebase, it also helps you avoid common error-prone code which you might write.