Archive for the ‘Book Reviews’ category

Code Complete

December 12th, 2010

Whew!  This book took a little while to get through.  That was partly because it’s a healthy 862 pages, and partly because I became addicted to StarCraft II halfway through reading it 😉  Nonetheless, it is an awesome book.  Five out of five stars.  Jeff Atwood classifies this book as “The Joy of Cooking for software developers.” I would have to agree.  If there was such a thing as a modern programming Bible, this is it.

This book reads like a how-to for all aspects of software development.  It begins with preliminary things like gathering specifications, defining prerequisites, and planning.  It moves through very high-level decisions such as choice of language for a project, and how much project infrastructure to use (build tools, version control, automated testing, etc).  It covers estimation, and different techniques for planning the development and integration of large projects.

The author then moves through high level decisions within your code.  Things like class structure, interfaces, and guidelines for creating routines are covered.  He weighs pros and cons of breaking routines into sub-routines, choosing parameters to pass effectively, and vital concepts such as abstraction and encapsulation.  There is a very informative chapter on defensive programming that covers topics such as error-handling, assertions, exceptions, and debugging.

The bulk of the book is on the nitty-gritty of writing code.  Variables are covered in depth. He thoroughly covers topics such as variable scope, initialization, placement, and persistence.  He devotes an entire chapter to variable names.  Following variables is an excellent discussion of data types.  Moving right along, conditionals, loops, and other control structures are covered in great detail.

Next McConnell takes the reader through various other aspects of programming, including collaboration, testing, debugging, refactoring, and code tuning.  Finally, the book addresses topics such as the effect of project size on construction, using programming tools effectively, code documentation, and the considerations of programmer personalities themselves.

What stuck out most to me about this book (and what makes it stand out from the crowd) is the author’s effective merging of both professional experience and academic knowledge.  For things like variable names: he won’t just tell you a variable name should be between 7 and 20 letters, he’ll cite a study showing that code using variables of that length were shown to have fewer bugs.  The book is filled with pieces of “hard data” that are usually a result of a formal study that confirms what he has learned through experience.  McConnell’s bibliography is extensive, and his command of sources is impressive.

Also, what impressed me about this book is how the small topics reinforce larger themes.  One of the primary tenets of good software construction (and one that is thoroughly covered here)  is managing complexity.  Concepts such as good class structure, good routine names, and good commenting are not effective for their own sake.  They are effective because they make code less complex and easier to understand.  Programs that are broken down into smaller, less complex pieces are programs that are easier to develop, debug, and maintain.

All in all, I would strongly recommend this book to any software developer.  Even if you don’t feel like reading through a 2″ thick book with thin pages and no pictures, you can jump to any particular topic of interest and absorb what tidbit you need.  The book is also structured well enough to serve as a reference.  It will likely serve as such for me until a year or two from now when I plan on re-reading it.  It’s that good.

Book Review – Code

April 18th, 2010

I just finished reading Code by Charles Petzold.  This book is like no other I’ve ever read.  This book explains how computers work.   Think about that for a second.  Do you know how a computer actually works?  Really?  This isn’t about double clicking on the blue “E” to access the internet.  This book explains how a machine can take electrical 1’s and 0’s and use them to do math, save files, display graphics, and everything else a computer does.

I love the way the book progresses.  It starts with the most basic of electrical circuits.  Simple light bulb and battery type stuff.  It spends a few chapters building your circuit board chops and BAM!  – he shows you how you can wire a circuit to add binary numbers.  Wow, you can now build a very simple computer.  He continues to add to what you already know piece by piece.   Components are added to the circuit board so that it can now perform subtraction, multiplication, and division.  You learn how a circuit can remember data, the basis of memory.  You learn the issues surrounding floating point math and how they are resolved.  He explains machine code, and how it can be simplified by assembly language, and in turn, high-level languages.

Mixed in with the technical chapters, he adds sections on lighter topics such as Morse code, Braile, alternate (non-base 10) number systems, and more.  He covers how letters can be stored as a series of bits, and why there are 8 bits to a byte.

This book changed the way I think about computers.  I highly recommend it to anyone who wants to understand them better.  Although it assumes no prior knowledge, this book is not for the faint of heart; some of the chapters require tenacity to stay focused and comprehend.  However, I guarantee it will be well worth it.

Book Review – jQuery in Action

April 9th, 2010

jQuery in ActionI just recently finished reading  jQuery in Action by Bear Bibeaut and Yehuda Katz.  I had used very little jQuery before reading it, and even less AJAX.  I can’t recommend this book highly enough.  Five Stars.  To be fair, I may be biased largely because jQuery is so awesome, anything about jQuery will inherit it’s awesomeness.  But either way, if you want to get into jQuery, this is a good place to start.

I’ve heard it pointed out that all of the information in this book is already online, on the jQuery website.  But that’s missing the point.  The book presents the information at a well-thought out pace and order, minimizing confusion.  For example, early on it spends a good amount of time introducing and explaining the various CSS3 selectors and getting your “Wrapped Set” of elements before it jumps into how to manipulate those elements.

The book process to move through all of the awesomeness that jQuery offers with DOM & Content manipulation, Event Handling, Animations, Plugins, and Finally AJAX.  My First attempt trying to implement AJAX was without a framework, using the WROX “Beginning AJAX” book.  I’ve decided that book isn’t worth it’s weight in lead, and that it should be pulled from the shelves.  jQuery makes it ridiculously easy to make POST and GET requests to the server, and handle the results.  I was using AJAX in production code within a week of reading this.

I don’t know what else to say.  The level of Awesome that jQuery exudes is matched only by other epic wins such as Dropbox and Vim.  If you haven’t tried jQuery, you need to. Now.

The Zen of CSS Design

December 7th, 2008
The Zen of CSS Design

The Zen of CSS Design

I recently finished The Zen of CSS Design. The book has a good display of creative website designs, and it’s good for providing inspiration. It organizes the content in an interesting way, where each chapter focuses on a single aspect of desgn: ie, layout, imagery, typography, etc.  Within each chapter, individual designs are dissected and evaluated as they apply to these design principles.

Unfortunately, I found much of the text to be cheesy and repetitive, not unlike what you would stick in a history paper to reach the word count your teacher asked for.  The author is at times ambiguous, and at other times attempts to wax poetic.

It suffers from an identity crisis that many web books do: It moves too fast for the beginner, and re-hashes the basics too much for the experienced. Myself being in the latter camp, and my eyes start to glaze over when I read how to use a “background-image” or “border” property.

Also, with many CSS books, it fails to acknowledge when compromises are necessary. There are times when it’s just plain better to use JavaScript or tables. As a working web developer with deadlines and budgets, you don’t have the luxury (burden?) of creating 10 lines of CSS and 3 divs just to avoid using a little 2 cell table.

Overall, I’m glad to have the book, but mostly for the eye candy rather than what it has to say.

Book Review: Apache Cookbook

November 30th, 2008
Apache Cookbook

Apache Cookbook

I just finished reading Apache Cookbook, Ken Coar and Rich Bowen. I’d give it a solid five stars. I found it to be very readable, and not overly verbose or cryptic, a problem that can plague computer books. The book is quite the opposite, if I had one criticism, it would be that it could be a little thicker. It’s only 264 pages, and the font is plenty big, which makes for a fast read.

Having set up and run an apache server for a few months, I skipped over many of the early parts of the book. However, I did find lots of useful tips, tricks and tidbits, that I know will come in handy later. For example, I didn’t know you could make a custom log for any site, with any file, that contains almost any information. You simply specify a CustomLog directive for whatever host you want to monitor. I now set up several specific logs show me only the information I find useful.

Other useful directives are RewriteEngine and RewriteRule. You can do almost anything you want with the URLs from your site, including redirection, query string modification, folder modification, clean URLS and more. This all comes from the module mod_rewrite. There’s useful info on authentication and authorization, dynamic content, custom error pages, email notification, and much more.

Here’s a doozy: you can now use apache’s mod_proxy_balancer to balance a load between a cluster of computers! Who knew it was so easy! You can even specify with the ProxyPass directive whether to distribute by bandwith, or by requests!

A few other tidbits that I’m sure will be useful are the Apache bench utility for benchmarking site performance, and server-status which can monitor your server health and display it somewhere in your website.

All in all, I’d recommend the book, and I see it being a useful reference in the future