Related link: http://www.refactoring.com/
Finally reading the famous Refactoring by Martin Fowler, and man, I think this is one of the best books on programming I’ve ever read.
It might has well have been called “How to Write Clean Code”! It’s NOT just for bringing your program to the hospital when it’s desperately sick! Don’t just wait until you need to re-write a program to read this book! It’s for every-day every-function every-line you write. A toolbox of ways to keep your code clean, whether something you wrote two minutes ago or two years ago.
Since I didn’t learn programming in school, but from scattered articles and books, I’ve read mostly on the microscope-level : how individual commands work, how to query a database, how to make a class and object, the basics of encapsulation, etc.
But I’ve always wanted to see shining examples of great coding that puts these ingredients together! (”Now that you know the ingredients - here’s how to USE them wisely.”)
Refactoring does that better that anything I’ve read to date, with perfect-sized examples showing just enough to make each point and show it in a scaled-down version of a real-world situation.
By the way, if you read it online in O’Reilly’s Safari Bookshelf, it has the even-better benefit of all of the refactorings mentioned being hyperlinked directly to the info about that refactoring! (Hm… just realized that sentence doesn’t make sense until you’ve seen the book. But he’s constantly referencing other sections of the book, so in the paper version you’re constantly flipping around to keep a few chapters open at once. In the e-book version, it’s just a click away, with a back-arrow.)