I’m not even halfway through yet, but O’Reilly’s Beautiful Code really is a great book on the arts of programming. It contains about 30 essays by top-notch programmers, including veterans like Brian Kernighan or Charles Petzold, on what they consider beautiful code or programming concepts. The chapters vary greatly in difficulty, including both (rather) easy-to-understand concepts like a regexp matcher in 20 lines that show why simplicity is often a win and very specialized contributions like an image filter in Microsoft’s Intermediate Language. I think this is a book best read not cover-to-cover, instead just pick the most interesting chapters for you and see how elegant code can be.
One thing that also comes to mind reading this book is how short-lived many of the contributions were. Once-glorious hacks like Windows’ bitblt() implementation do not have much relevance in today’s world, where Google’s Map-Reduce provides the foundation of an enormous technological success story.