Robert C. Martin, during his keynote at QCon London 2010, tried to figure out why there is so much bad written. He offers advice on writing good talking about a bad example, Boy Scout rule, functions, arguments, craftsmanship, , , pairing, small cycles, patterns, engineering, , and other elements contributing to qualitative code.

http://www.infoq.com/presentations/Robert-C.-Martin-Bad-Code