C/C++ Users Journal November, 2004
Code Complete, Second Edition
Steve McConnell
Microsoft Press, 2004
960 pp., $49.99
ISBN 0735619670
Steve McConnell's software construction handbook Code Complete (Microsoft Press, 1993) was widely praised at the time it was published, including a judgment of "required reading" from Tommy Usher in these pages. A decade later, the original edition of Code Completewith examples in C, Pascal, Basic, Fortran, and Adais clearly a product of its era; an updated edition is more than welcome.
As McConnell explains in Code Complete, Second Edition, the topic of construction has been neglected in literature in favor of other areas. We are awash in specialized books on object-oriented design, for example, and in references and tutorials about specific programming languages. Construction is the central activity in software development, the only activity that's guaranteed to be done, and one that is highly amenable to improvement: McConnell cites a study that found that productivity of individual programmers can vary by a factor of 10 to 20 during construction.
McConnell writes from the viewpoint of an experienced developer and development manager, with the breadth and knowledge of an experienced editor. It's clear from the reminiscences in the book that McConnell once worked at Microsoft; he's currently CEO and Chief Software Engineer at Construx Software. McConnell was editor-in-chief of IEEE Software from 1998-2002, and has written three other software engineering books.
In Code Complete, McConnell covers the gamut of software-development activities from the point of view of software construction. So, for example, he does a thorough job of teaching you how to recognize good requirements, without going into a lot of detail about how you generate good requirements. He spends most of his 960 pages on construction proper, with groups of chapters on creating high-quality code, variables, statements, code improvements, system considerations, and software craftsmanship. McConnell never seems to lack an opinion on best practices, even in hotly debated areas such as variable naming.
Even when McConnell advocates a specific methodology or practice, he does a reasonably good job of pointing out the alternatives and their tradeoffs, and an excellent job of supplying references. In Chapter 9, he advocates the "Pseudocode Programming Process," and does a good job of explaining it. Then he sends you to Chapter 22 and to "Kent Beck's Test-Driven Development: By Example" to learn test-first development; to Chapter 24 and Martin Fowler's "Refactoring: Improving the Design of Existing Code" to learn refactoring; and to Section 8.2 and Bertrand Meyer's "Object-Oriented Software Construction" to learn design by contract.
McConnell is strong on follow-up and clarity. Chapters start with summaries and end with checklists and lists of key points. Key points, hard data, and coding horrors in the text are marked with large icons in the margin; the margin is also the place to find cross-references, relevant quotations, and URLs. The URLs refer to http://www.cc2e .com/, and often bring up pages that include further web references.
Much of the content of this book will be familiar to experienced software developers. Nevertheless, it's still a useful book, even for lead developers and architects. You may have already formed an opinion on the great "goto considered harmful" issue, but you probably don't have the broad perspective on the debate, the alternatives, and the tradeoffs that McConnell presents. Of course, novices may never have heard of this debate, or the bad Fortran practices that prompted it, so for them the discussion will be invaluable.
Developers who have worn out their copies of the first edition of Code Complete might well want to pick up a copy of the second. Those whose copies of the first edition gathered dust, unread, might not want to bother with the second editionalthough they should be ashamed of themselves. Those who skipped the first edition, or weren't ready for it, perhaps because they were in middle school at the time, might want to take the publication of the second edition as an opportunity to broaden their horizons.
Is Code Complete, Second Edition still required reading? For software developers of all stripes, I would say, "Yes!"