Code Reading: The Open Source Perspective
Published January 04, 2004
Code Reading: The Open Source Perspective, by Diomidis Spinellis, is an interesting style of book. While most books on coding try to teach you how to write code, their examples are generally contrived. This book tries to help you to read code more effectively by providing real-world examples of both good and bad code. These real-world examples are taken from a number of Open Source projects, including NetBSD, Apache HTTPD, the hsqldb Java relational database engine, and the Perl language. Most of the examples are snippets of code taken from single files. The source files are mentioned, so you can read them in the context of the original project.
Code Reading is a book slightly at odds with its title. While the book is primarily about the techniques used to read code, it very quickly gets into hard computer science. The introduction (in particular Section 1.1 "Why and How to Read Code") is well written and informative. However, any beginner or intermediate coder may be turned off by the end of Chapter 2. There's an in-depth examination of the "notoriously difficult" (according to Donald Knuth) binary search algorithm in the C standard library that may become a stumbling block for some. The rest of the book flows much better, however.
Understandably the book focuses on examples from projects written in C, C++ and Java as they're the most popular languages in use today. If you're reading non C-derived languages, most of the principles in the book still apply, but some sections, or indeed entire chapters should be skipped. This book doesn't seem to be meant for a casual reader. I think it would work best in a classroom situation. I agree with the author that it's about time that code reading became part of computer science curriculum. He mentions that "Dick Gabriel makes the point that ours is one of the few creative professions in which writers are not allowed to read each other's work".
I would add that we're also not encouraged, even when we are allowed. I would recommend this book to any coder who's serious about their craft.
Posted on behalf of Martin Feeney.
- Code Reading: The Open Source Perspective
- Published: January 04, 2004
- Type:
- Section: Books
- Filed Under: Books: Computers and Internet, Books: Nonfiction
- Writer: Maura McHugh
- Maura McHugh's BC Writer page
- Maura McHugh's personal site
- Spread the Word
- Like this article?
- Email this
Save to del.icio.us



