Probably it's true for type of bugs which could be catched by some kind of static analysis tooling (using uninitialized variables and etc.). You need just to remember some set of rules and never do "bad things".
But what about bugs produced by unexpected inputs, system misconfigurations and so on