Error prevention is NOT complete if it is only done in the early stages of software development. So, what do we need to do to facilitate error prevention in coding?

The basic principles:
1) Write codes that are easy to read ;
(2) Write codes that can be tested easily and independently ;
(2) Aim for absolute correctness, not conditional correctness ;
(3) Establish several layers of abstraction if possible ;
(4) For each table, for any functional purpose, a piece of code should appear in 1 place only.