Classic Coding Tome Updated
Tim Halloran writes "Steve McConnell has updated his book 'Code Complete' a 960 page language agnostic tome about code construction. This is the best book of its type I've ever encountered and the update is welcome (as the first edition is over a decade old...I suddenly feel as I'm getting old :-). More information, and a sample chapter are here. As a programming team lead I have provided this book to team members to get them critically thinking about how they write code."
Read the Preface .pdf. It spells out exactly what the author thinks Experienced Programmers, Technical Leads, Self-Taught Programmers, and Students will get out of the book.
I learned to program in grade school, taking little projects from Computer Recreations and implementing them in MS Basic for the Macintosh. This was not the most conducive way to learn to program in a disciplined fashion, and yet in the early nineties I found myself having to program to spec and to schedule for various people, and not doing too well. It was not until I picked up the first edition of this gem that I truly understood that the craft could be approached as a discipline, that code quality does matter to software quality, and that a well-constructed program is more maintainable and extensible.
If all McConnell did was slap a new cover on it, it would be worth looking into if you've never read it. But he put several chapters out last spring for review, comment, and critique, including some all-new chapters. I'm definitely picking it up when it becomes available.
He was a verray parfit gentil knight.
If you read the first edition, one the things it did was give weight to things that are "obvious."
It's obvious that indents should be no more than 4 spaces and no less than 2 spaces, and that only one option should be used consistently throughout a given body of code. The cool thing was that the book gave you the results of studies that backed up this "obvious" statement. It put programming lore on a factual basis.
I came to the first edition of Code Complete with several years of programming experience under my belt. I had much the same response to it as I did to Pragmatic Programmer, namely that it helped me understand why I had developed some of the habits I had. It also helped me find those areas where I still needed polish.
Both of these books aimed at teaching how to program well, not how to program. I hope this second edition is up to the standard of the first.
The book is aimed at developers who may have graduated from some college class that taught them the Java language (for example), but did not teach them how to use it properly. Browsing through the sample chapter you mention, it seems to stay true to the character of the original. I notice on page 21 of the PDF that he discusses studies on information hiding. You and I may know the value of encapsulation, but the book points to facts that back up our lore on the subject.
The upshot of this fact is that Code Complete looks great in a references section of document that makes a technical argument, in much the same way The Mythical Man Month does (a stunning achievement in IT literature... it's ~ 30 years old and still right for the most part). All three of the books I mention here are worth reading simply because they capture good programming practice in a way no other piece of writing has.
If your comparison were to be fair, Code Complete would be in its 13th edition with each new edition bringing a rearrangement of chapters for no apparent reason, 10 new pages of content at most, and entire sections devoted to tools nobody can use or figure out without purchasing the supplemental Inside Code Complete, 13th edition and subscribing to the CCDN (Code Complete Developers' Network).
There are no karma whores, only moderation johns
I can also strongly recommend McConnell's Software Project Survival Guide (amazon link). I think all software team leaders and project managers should read this book as it packs a lot into a small number of pages. Amazon link: Software Project Survival Guide
I have a copy of 'Solid Code', also put out by Microsoft. It's actually a very sensible, no-nonsense book about writing dependable code. The book is well written full of good advice, regardless of the fact it's published by 'Microsoft Press'.
My only reservation about the book is the author's insistence on using Hungarian Notation.
In all fairness, I think there are plenty of people at Microsoft that know how to write good solid code. They probably have a few incompetent coders on staff, but I think generally their coders are very talented. They do have pretty high standards for their people.
Many of Microsoft's infamous software flaws can be traced back to their emphasis on features and ease of use, rather than quality. After all, if you ran into a bug, it was probably something you could fix by buying the next version.
Recently, they've started to focus more on quality--I hope this translates into actual results and not just lip service.
This book is the best programming book I have ever read.
;-)
I believe that my own productivity increased by about 50% at least after reading it.
Code Complete answers many of the questions that nag the working programmer, and busts through much of the BS that people spout about programming.
The book covers a huge range of material, from code formatting and style, to how to build teams. Clue: don't put all the programmers no one else wants in a team to build an important project
The writing style is friendly and peppered with hilarious case studies such as 'Escape from Gilligan's Island', where the same mistakes happen over and over again.
Everyone who has worked on large programming projects will recognise some of these anecdotes. In one case I watched from start to finish as an 'experienced consultant' ruined a perfectly good project with secrecy over his bad and undocumented code. All the warning signs were there. If the manager had read this book, a programming catastrophe might have been averted.
I have bought this book a few times, and given it to management in-duh-viduals to read. Sometimes it helped.
If you are a programmer or a manager, or just interested in software, buy this book and read it. I guarantee you will learn something.
-- "It's not stalking if you're married!" My Wife.