I wonder whether there are good ways to become a bugless coder. Do I need to build some style. I am mostly interested if the top teams of ICPC train their coding by some specific ways (except participating in contests). Good books (or links) teaching the principles of good coding are welcome.