Joel Spolsky (Who runs Fog Creek Software) compiled a very insightful 10 item hit list on how to write better code. A lot of good points. I especially like the points about quiet working conditions and one step builds... Check it out:
http://www.joelonsoftware.com/articles/fog0000000043.html