A frequent topic of discussion among those in any technical field is for a short list of essential books that anyone worth their salt has read. With regards to software engineering, two classics quickly come to mind: Code Complete, and Design Patterns, as well as a recent publication joining the ranks of these epics, Beautiful Code by O’Reilly Media.
What makes Beautiful Code stand apart from the rest, is that it’s format is so unconventional when compared to most other programming texts. The book is comprised of 33 Chapters, each written by a different author about a particular bit of code they had written and thought to be particularly eloquent. The best way to explain why this book is so wonderful is to make an analogy about the differences between learning something via a lecture as opposed to a private lesson. Most instructional books will take the lecture approach, where the author shows you one correct way to solve a problem, or complete a certain task and the reader must then digest that as best as possible. Beautiful Code is more like a private lesson in which the author of each chapter is giving the reader personalized attention by explaining their thought processes, how they arrived at each step, and occasionally showing some dead ends that didn’t work out. Now consider that these private lessons are being given by such legendary names as Brian Kernighan, Charles Petzold, and Yukihiro Matsumoto – and it becomes obvious why this is a must-have addition to any serious software engineer’s bookshelf. Some particularly memorable sections include Karl Fogel’s discussion on the origins and implementation of the Subversion Delta Editor and the look inside Google’s MapReduce technology by Jeffrey Dean and Sanjay Ghemawat.
As stated earlier, one of the best strengths of this book is that it is language neutral. In each chapter, as the author is speaking from experience on a particular project, rather than writing a chapter for a hypothetical “Better Programming in Language XYZ”, you will see code snippets in C#, MSIL, Python, Ruby, and several other languages (There’s even one chapter with Emacs Lisp!). This is important because the insight gained from this book will not be diluted from one language falling out of favor or into obsolescence, and allows for the possibility of this title being just as valuable ten years from now.
Many books will teach you how to solve a problem, but rare are those to teach you how to think. Beautiful Code is one of those select few, and will keep you coming back from project to project to consult its veteran sages of computer science. A worthy edition to any serious programmer’s library, and hopefully a second volume is not far off.
17
2007
Learn How to Think
11
2007
More on Programming for Beginners
A while ago, I wrote a post about how I think that programming is really difficult to get into these days without a ton of effort on the learner’s part due to varying factors such as language complexity and operating system api’s. I then proceeded to discuss a product by MIT Media Labs called Scratch that was designed to teach children programming by addressing these issues. In case you don’t remember, I wasn’t too fond of Scratch.
Last night at the Chicago Ruby Users Group, there was a presentation on Shoes, which is another project in this vein that uses Ruby as its underlying language. Shoes addresses all of the complaints I had with Scratch, and lets you write code instead of relying on a mouse/GUI driven interface. Writing a program in Shoes is very straightforward, and you can do a lot of neat stuff in a very few, simple, straightforward lines of code. I was pretty impressed. This is exactly the type of thing we need in a world that is devoid of QBasic.
Here’s a screenshot of a sample program called follow.rb that draws circles depending on the position of the mouse cursor: (the sourcecode is in the terminal to the right of the demo)
This screenshot doesn’t really do it justice though – because Shoes is built on top of Cairo and Pango, the demo runs very smoothly and doesn’t reek of jittery animation like so many other sandbox programming environs.
While it’s definitely not a finished product ( 1 or 2 of the demos segfaulted on me due to some C code in the Shoes app) – it runs on Windows, OS X AND Linux. I had no problems checking out the source from subversion and building Shoes on my Ubuntu 7.04 laptop. Shoes is a huge step in the right direction with regards to addressing the issue of getting kids into programming by making it less of an impossible task. I look forward to watching this project develop, and really hope that it catches on.
