

💻 Code smarter, not harder — the ultimate programmer’s playbook!
Code Complete by Steve McConnell is a monumental 862-page programming bible focused on software construction. It offers scientifically-backed, practical guidance on coding, debugging, testing, and optimization. Widely regarded as the industry standard, this book empowers developers to write cleaner, more maintainable code and fosters better team collaboration. Ideal for professional programmers seeking to master the craft and boost productivity.





| Best Sellers Rank | #118,348 in Books ( See Top 100 in Books ) #1 in Client-Server Networking Systems #89 in Software Development (Books) #204 in Computer Software (Books) |
| Customer Reviews | 4.6 out of 5 stars 1,336 Reviews |
H**E
A must-read for every programmer
The focus of Code Complete is software construction, i.e. the coding part of software development. As Steve McConnell notes in the preface, "construction is the only activity that is guaranteed to be done". You can skip almost any step (requirements, testing etc), but if you don't write any code there is not going to be any software. I bought my copy of the first edition of Code Complete in 1997, and I was immediately fascinated. I had never read anything like it before - a book that concentrated on the actual writing of the code. For example, it had a whole chapter on if- and case-statements, and another chapter on the naming of variables. I had no idea there was so much to learn about these seemingly straight forward activities. It was immediately useful to me, and I started to apply as much as I could of what I learnt from it. Although it concentrated on coding, it covered a broad spectrum of activities around coding, from requirements and design to testing, debugging and optimization. It also had a great reference section with suggestions of further reading in the area of software engineering. This became my starting point for finding lots of other good books to read, like Peopleware: Productive Projects and Teams (Second Edition) and Programming Pearls (2nd Edition) . So this summer I decided to re-read this seminal book, partly to see what's new in the second edition, and partly to see if still think it is such a great book. To answer my own question - yes, it is still the number one book on writing code. It is near encyclopaedic in its coverage of the nuts and bolts of programming. There are chapters on the naming of variables, on organizing straight-line code, on conditionals, on loops, on lay-out, on good commenting and on how to write good methods. In it, there are frequent references to scientific studies that support the advice given in the book. For example, how long should variable names be? Instead of just giving us his opinion, McConnell summarized the findings of several scientific studies on the subject. Each time there is reference to a study, there is a little "hard data" symbol in the margin. There are other symbols in the margin as well, "Coding Horror" for code examples of what not to do, and "Key Point" for, well, key points. The margin is also used for cross references to other chapters, and for quotes related to the subject discussed. For me, this works really well. It is both useful and makes the text easier to read. In general, the book is very well laid out. Some of my favourite advice from the book (all of which I remember from reading the first edition) are: Chapter 7.1 Valid Reasons to Create a Routine - for example: Reduce complexity, Introduce an intermediate understandable abstraction, and Avoid duplicate code (there are 6 more valid reasons in this chapter). The second part of the chapter is called Operations That Seem Too Simple to Put Into Routines and contains a great example of why it can be good to put even a one-line calculation in a routine - the code becomes more readable, and small operations tend to turn into larger operations. Page 172 (and 264 for variables) Use opposites precisely. When naming "opposite" methods and variables, be careful to use the correct pairs, like add/remove, begin/end, create/destroy etc. This makes the relationship between them clear and obvious. Page 433 Break complicated tests into partial tests with new boolean variables. This is such a simple thing, but it makes the code a lot more readable. Page 754 "Make the incompleteness of a statement obvi". For example, when breaking up a logical and over two lines, end the first line with && - that way, it is clear that the statement continues on the next line. Even though the book truly is great, there are a few things to complain about. In the first edition, the chapters on layout and comments came right after the chapters on the different control structures. But in the second edition, these two chapters have been moved further back. To me, that doesn't make sense, since they too are related to how you actually write your code. Now there are chapters on testing, debugging, optimization and refactoring in between. And talking about refactoring: while this is an important subject, I don't feel the chapter on refactoring is particularly good. This chapter is new in the second edition. The summary of refactoring is OK, but a good part of the chapter consists of just listing different kinds of refactorings. Overall though, the second edition is a nice face lift. The code examples are now mostly in Java, C++ or Visual Basic (in the first edition they were in Pascal, C or Ada). But since all the major themes of the book were already present in the first edition, it does not make a big difference if you happen to read the first edition instead of the second edition. Code Complete is thick - 862 pages (not counting the bibliography and index). If that feels like a lot to read, then I suggest you start by just reading one or two chapters, for example "Using Conditionals" or "Layout and Style". They (and pretty much any chapter in the book) can easily be read without first reading the preceding chapters, and these will give you a sense of what you can expect from the other chapters. Even if these are all you read, you will still get a lot of value from the book. However, if you are a programmer and care about how you write code, you owe it to yourself to read the whole book. It is considered by many (including me) to be the best book available on programming, and it will almost certainly make you a better programmer. Highly recommended.
B**S
Comprehensive, scientific, well-organized and monumental
This book deserves 5 stars because it is a comprehensive analysis of software construction, it is objective and scientific, it is well-written and well-organized and it carries a lot of weight in the software industry (yes, this is important). Comprehensive Analysis of Software Construction This book’s scope is the “construction” of software which primarily includes detailed design, coding, debugging, integration and developer testing. According to McConnell, there wasn’t a book written on the construction aspect of programming at the time of writing the first volume (in 1993). Also, according to McConnell, construction is the most important part of programming as it takes up the most time, it must be done, and it has the biggest impact on the success of a project. To sum it up, this book touches on everything you need to know during the construction phase and has a chapter devoted to each topic. My favorite chapters are Chapter 6 (Working Classes), Chapter 21 (Collaborative Construction) and Chapter 33 (Personal Character). Go look at the table of contents if you don’t believe this book is comprehensive. Objective and Scientific McConnell backs up most of his claims with scientific evidence (referencing the results of different programming studies) throughout the book. He is also objective and presents dissenting opinions when there isn’t a clear winner. He is also honest when there isn’t much evidence to support his claims (for example, there isn’t actually much evidence backing up his documentation techniques even though they are probably best practice). This builds trust between the reader and the author. We know he has done his due diligence and we don’t need to go fact check everything. His technique of backing up opinions with scientific studies is surprisingly lacking in most software communities. It makes me realize how often we spout opinions without backing them up with hard data. Well-written and Well-organized This book might be dry at times, but it’s very well-written and well-organized. You can skip around to different sections and use it more like a reference instead of reading cover-to-cover if you’d like. My favorite parts of its organization are the ‘Key Points’ highlighted throughout the text, the checklists and key points at the end of chapters, and helpful code examples which reinforce his points. Also, I love his metaphor that you should organize your code in a similar logical structure that you would organize a book (with table of contents, sections, chapters, etc.) Some will say the book is repetitive (and it can be), but repetition is important because you rarely remember anything after reading it once. Repetition is the way ideas are reinforced and remembered. Carries a Lot of Weight in the Industry Some might argue this shouldn’t be a factor when reviewing a book, but I disagree. When you are newer to the industry (I’ve been programming professionally for around 2 years), you need to learn from the best. The way you identify who is best is by someone’s reputation and status in an industry. This book (and McConnell himself) are held in high esteem by very influential people in the industry. This matters because you can trust the concepts he is advocating and move quicker in your learning. Conclusion Overall, this book is a must-read for programmers and will probably have the best ROI for programmers who have been working professionally for 1-2 years (because you’ve seen some of the good and some of the bad practices that McConnell talks about). Yes, this book is long, sometimes dry and repetitive, and some advice is obvious. But it absolutely helps give more confidence when constructing software, when giving code reviews, and when forming a culture of good habits on your team. The main takeaway is this: your number one goal as a programmer is to manage complexity. Make things easier to understand, more readable and more maintainable - it will save time in the long-run. We spend much more time reading code than writing code. It’s important to think about the programmer who will be reading and maintaining your code (a lot of times it is yourself). We aren’t smart enough to understand entire codebases and we are limited by our brains. Use techniques like abstraction, encapsulation, self-documenting code, and collaboration with other programmers to make your code better.
A**G
A wonderfully practical guide to programming
The tragedy for books that become classics is that there are many more people who have heard of them (or perhaps also bought them) than people who have read them. In this case, the fact that Steve McConnell's "Code Complete" is approximately 900 pages long doesn't help, either. Even so, this is a book that not only deserves to be read, but also rewards multiple readings. The Good: McConnell deserves credit for writing the first (and only?) readable encyclopedia of best practices on software quality, covering topics such as how to build classes, use data and control structures, debug, refactor, and code-tune. Yes, it would be nice if the book was updated to include substantive material on languages like Ruby or Python (cf. p. 65, Python "also contains some support for creating larger programs") but, in the words of Gertrude Stein, "Not everything can be about everything" -- though Code Complete does come pretty close. This book contains an astonishing number of practical points on a variety of topics. Here is a quasi-random selection: a) don't use booleans as status variables (chs. 5, 12), b) when you feel the need to override a function and have it do nothing, don't; refactor instead (ch. 6), c) when choosing variable names, avoid homonyms (ch. 11), d) if you decide to use a goto, indenting your code properly will be difficult or impossible (ch. 17), e) trying to improve software quality by increasing the amount of testing is like trying to lose weight by weighing yourself more often (ch. 22), f) make your code so good that you don't need comments, and then comment it to make it even better (ch. 32), and finally the oft-repeated g) you should try to program into your language, not in it (ch. 34). McConnell also sprinkles the text with classic words of wisdom, e.g. "The competent programmer is fully aware of the strictly limited size of his own skull" (Edsger Dijkstra), "Never debug standing up" (Gerald Weinberg), "Copy and paste is a design error" (David Parnas), "Any fool can defend his or her mistakes -- and most fools do." (Dale Carnegie). It is important to point out that even though this volume is encyclopedia-like, it does have both a sense of humor (e.g. "the encryption algorithm is so convoluted that it seems like it's been used on itself") and a clear authorial voice (e.g. "Though sometimes tempting, that's dumb."). Another example of the latter: in ch. 33, after quoting Edward Yourdon at length, McConnell adds "This lusty tribute to programming machismo is pure B.S. and an almost certain recipe for failure". The Bad: overall the writing is very good, but the occasional infelicity reminds us that McConnell is human (e.g. p. 369 "A loop-with-exit loop is a loop in which", p. 809 "A program contains all the routines in a program."). In a technical book of this breadth, minor mistakes are bound to creep in. For example, in ch. 10 McConnell mentions the different possible levels of a variable's scope in C++, and then adds that in Java and C# one can also use namespaces, thus effectively ignoring the existence of the namespace concept in C++ (which is baffling, given that he then discusses precisely that topic in ch. 11). Another example, this one more serious, is McConnell's recommendation that you should use a pointer - not a reference - if you want to pass by reference in C++ (ch. 13), something which is contrary to C++ best practices (see e.g. Sutter & Alexandrescu, "C++ Coding Standards", Item 25). A less technical point: in ch.2 McConnell criticizes Frederick Brooks for writing (in 1975): "Plan to throw one away; you will, anyhow". I found this to be bizarre, given that in the 1995 edition of "The Mythical Man-Month" Brooks states in no uncertain terms that he has changed his mind on this: "This I now perceive to be wrong" (p. 265). Given that Code Complete 2 was published nearly 10 years later (in 2004), criticizing Brooks for his publicly repudiated former opinion seems improper. On a different note, although some of the on-line accompanying material is fascinating (e.g. the links to the original Dijkstra and Lawrence articles in ch. 17) many of the links are just electronic versions of McConnell's checklists or bibliographies, while some are simply disappointing. To name only a couple of these, as of this writing the link on p. 856 on the economics of XP is a dead link, while the one on p. 76 is downright embarrassing (it links to a google search for "emergent design"). Finally, even though the book has a dedicated website, no list of errata is provided there. If you dig deeper, you can find one on the O'Reilly website, but that is woefully inadequate, e.g. it contains no information on separate printings. The most common criticism one hears about this book is that any decent software developer should already know the material covered in it. Ironically enough, this is true. To quote Dr. Johnson: "People need to be reminded more often than they need to be instructed". Alex Gezerlis
G**A
The pages are thin, so handle the book with care
I just opened the book, one thing I noticed is that the paper is too thin. For me is not a problem, but it means you need to be careful. Overall I think the quality of the content is not bad, and I Iike the fact that the paper is not bright at all, which is good for reading.
B**D
Recommended for *nix Programmers as well
I finally decided to invest the time in reading Code Complete after hearing well-spoken computer scientist Greg Wilson sing its praises on a Ruby Rogues podcast episode. Greg felt this book should be the core textbook in every undergraduate CS program although he will buy you a beer if you can find it in one. Greg says that Steve McConnell has practically memorized every significant industry paper written in the last 30 years. That knowledge shows in this book and its an especially great read for those who want hard data to back up claims. Even though Code Complete is arguably the most recommended programming book in the industry, I get the sense it is underappreciated by most folks who work in my ecosystem (open source/ruby/linux/etc). Whether that is true or not, here are a few reasons why I think it may be the case: 1.) "It is a Microsoft book and uses Visual Basic in some of the examples." Well, after reading the book cover to cover, I don't feel either of these were a problem. McConnell makes the conscious choice of using multiple programming languages throughout the book under the rationale that a good software craftsman should be comfortable parsing somewhat unfamiliar syntax. He even points out an instance or two where he feels a VB implementation decision is superior to what is found in most programming languages. Don't get me wrong, nobody is saying VB is a great language, but to write off the book because of the connection would be foolish. 2.) "Its a book about things I already know. I found a bullet point summary online and didn't have any 'aha' moments". My response to that is this: While I can't point to any particular section that will be mind blowing for most developers, I found myself transformed into a much better programmer while I was reading this book. Furthermore, in 2012 Sandi Metz released a book that has become an undisputed classic in the Ruby community. It turns out that a lot of the good OO design practices taught in her book appeared in Code Complete many years earlier in language-agnostic form. 3.) "Its almost 900 pages". I admit--the length of the book is a drawback. However, when you examine the contents, it is clear that McConnell is attempting to cover more ground in a single book than anyone before or since. It is also pleasant reading--not light reading by any means, but its not stereotypical textbook reading. Something I did not know about this book in advance is that it is an excellent gateway book for the software engineering classics. What do I mean by that? Anyone who has done research on widely recommended software books knows that the list of classics is long and intimidating. Code Complete is the only book I've seen that incorporates ideas from dozens of classic works. There is an entire chapter based around Martin Fowler's Refactoring. The Mythical Man Month and The Pragmatic Programmer are quoted throughout. McConnell ends the book with a software developer reading plan that includes him giving a great testimonial for Programming Pearls. There are also references to Effective C++, Peopleware, and Kent Beck's TDD just to name a few more. Finally, to show I'm not a total fanboy, I'll list a few things that were a little disappointing. 1.) McConnell dismisses functional programming pretty early on in the book. He believes in avoiding recursion unless its going to save you a massive amount of coding. While I wasn't expecting functional programming to be a core value in the book, I think it looks bad 11 years later that it was waved off as inconsequential. And for those who are wondering, no, SICP did not get a shout out. 2.) Going back to the Microsoft connection, I feel as if the words "open source" were tiptoed around. To his credit, McConnell does recommend SourceForge as a place to look at production code that is likely well-written. However, the way it was presented felt as if he was walking through a landmine and trying not to set a suit on fire. 3.) Similarly, the value of Unix tools felt downplayed. The tooling chapter felt it was more appropriate to describe tools anonymously because tools change over time. While there is definitely some truth to that, it felt a bit like a way to justify confining Unix tools to a paragraph. In summary, I would recommend this book to programmers at any level. Its one heck of an education for around $30 and deserves its reputation as a classic. When you finish, you will feel as if you completed a long apprenticeship with a master.
S**N
The definitive book on software construction.
I don't know how much more I can say about this book that hasn't been said already but I will do my best to describe my experience with this book. Have you ever looked at a class, or a method that seems to work fine but it just doesn't "feel" right? For some reason it seems as if that method or class may be hard to debug in the future or that the code is hard to understand. Or have you gone back to a class file you wrote months ago and you spend an awful lot of time trying to figure out what the heck is going on with that class file? Maybe the methods in the class are spaghetti like in nature, or maybe the names of your methods don't have a very good description so it's hard to figure out how everything ties together. I have had this problem. This book will teach you how to get out of those habits. You will learn what a solid class or method looks like. You will learn how properly naming your classes and methods can greatly reduce complexity in the long run. Everything is backed by hard evidence. I should also mention that this is just one chapter in this wonderful book. This book really drills down proper programming practices. A lot of times you may read a passage and think to yourself "well, of course!"... but then you realize you don't practice what's contained in the passage you just read. This book is great for both new programmers and experienced programmers alike. New programmers benefit greatly because they will learn how to construct software properly without having to go through all of the hoops. Experienced programmers will also learn a great deal, as well as be reminded that some of their habits that they've developed over the years can hinder production and cause software development to become more complex then it really is. Steve writes in a very clean style. It's very easy to read. You don't need to memorize anything in a book like this, instead you just need to gain an understanding of the concepts he brings forth. After reading this book I definitely follow a lot of his advice. When I build a new class, method or what-have-you I get a certain feeling of when it seems right and when something seems wrong. I am now much better at analyzing my code and figuring out what doesn't seem correct and I take his advice I learned in this book to help me to figure out - and correct the problem. After reading this book I feel like a lot of my rough edges as a developer have been rounded out. I feel as if I gained a years worth of experience just by reading this book. This book is friendly for any software developer. The concepts he presents apply to all languages. This is a book that teaches you how to think about programming better and how to construct good solid code. This is one of the best books I've ever read. If you're even thinking about buying this book, then buy it.
P**E
Excellent even though it's old
Use this book to make a decision for you or your company on the programming standards you want to follow. This provides clear statistics and reasoning behind the choices. Don't let it be a guess. This is a well-structured book that is easy to grasp for anyone. This book talks about Java and C++, with some VB and ADA, very little of C# which is what I am using it for, but really the principles are the same for all. It is aimed at programmers and managers, not architects. It covers a lot that is very important to the beginning or advancing programmer, or in my case, someone that wants to create standards for the programmers. Very complete and excellent for that purpose. It was written a while ago, so it needs to be updated. The points it covers are not outdated but still relevant to today. It repeats the main points many times over in different ways, so it is driven in. Excellent as required reading for newer programmers if they want to know why they should follow standards. Also see books (and videos) by Robert "Bob" Martin, and Microsoft online manuals, among other resources that are more current, more detailed, and in my opinion, more boring. Reading from a variety of authors will provide a solid foundation for a decision on the programming standards you want to follow. The goal for all of these books is quality programming with fewer errors.
P**Y
a classic and for good reason
There is a reason that this book is consistently listed as among the top computer programming books. I have not read Knuth's books yet, but I have read a lot of other programming books and of the ones I have read, this is the one I would most recommend. Whether you are fresh out of college or are a seasoned veteran of the code wars, there is likely something in here you could benefit from. Almost every aspect of software development is covered, from requirements, to how to build functions, to testing, to debugging, to refactoring, and more. Not to be left out are what metaphor to use (he says is should be construction, not farming or growing) and personal character. Those last two are not often found in software development books. The author makes frequent use of data when discussing things like the cost of errors based on when they were found or the best method of quality control. Some good advice concerns the importance of getting multiple eyes on a piece of code, use of test first development, understanding the problem before attempting to code, use of "the scientific method of debugging," the pseudocode development strategy for writing functions, and the importance of making code readable (by humans). If you were to find a flaw in it, it would most likely be that it is a little bit dated now. The concepts are still valid I think, but some of the data is pretty old. a few memorable quotes: "In general, the principle is to find an error as close as possible to the time at which it was introduced. The further the defect stays in the software food chain, the more damage it causes further down the chain." pg 29 "Managing complexity is the most important technical topic in software development." pg 78 "All in all, I think test first programming is one of the most beneficial software practices to emerge during the past decade and is a good general approach." pg 504 "All things considerd, debugging is an extraordinarily rich soil in which to plant the seeds of your own improvement." pg 538 There are other gem quotes but I was not able to locate them all while writing this review, so you'll need to study the book and find them for yourself...
Trustpilot
1 week geleden
2 weken geleden