I've seen a lot of bad code in my day, and one of my favorite parts of the "Communications of the ACM" magazine that I read is "Kode Vicious", a writer who criticizes bad code.
But how do you write "good" code? In this issue Kode goes into some things that he does like, but he doesn't go very far. So I searched the books here at InformIT, and I've started reading this one: Clean Code: A Handbook of Agile Software Craftsmanship
I haven't gotten that far into it, but I'll let you know what I think of it once I do. You can check it out at this link: http://www.informit.com/store/product.aspx?isbn=0136083226&f1=rss
Take advantage of special member promotions, everyday discounts, quick access to saved content, and more! Join Today.