An excellent, excellent tactical construction book.
Fantastic to add to your collection. Highly recommended for beginners as it introduces a lot of good practices in a balanced approach. Extremely good value.
A prepublication version of the second edition is available here: http://stevemcconnell.com/cc2/cc.htm
(due to its imminent publication, the text of CC2 is no longer available online. Pub. date is beginning of June 2004 -- MikeWoodhouse
See also SteveMcConnell
An extremely outdated one, even for a procedural programming book. It still talks about K&R C in 1993. I think Microsoft was one the few companies doing compilers that didn't have a (virtually) fully compliant ANSI C compiler. And WritingSolidCode
is a much better book, though equally outdated (its copyright is 1993). -- JohnPfersich
Samples may include older languages, and some aspects may not apply to newer languages, but good style transcends fashion. This book still applies largely to creating good software. ThePsychologyOfComputerProgramming is still a valuable book even though the languages and computer systems have changed since it was first written.
Agreed. A great book, and no more outdated than ElementsOfProgrammingStyle
, or TheArtOfComputerProgramming
. The idea that every computer book has to feature some hot new programming language is one of the bad things about the computer book industry. -- KrisJohnson
Just "finished" the book (Dec 2003) and I agree with the outdated comment. It is a pain to read through advices like limiting variable scope or using the correct variable type after spending a few years reading this Wiki. After reading 1/3 through the book, I can't stand it anymore and skimmed through most of the rest, reading only the design/architecture/management stuff in detail. Still, I think it will be good for beginners though. -- OliverChung
I thought I'd try re-reading the book after the comments above. All I can say is that, if you think this book is good, you really
need to go back to school to learn programming. -- JohnPfersich And your reasons for saying that?
My take is that the sections on writing code is too elementary, it is like reading a book about writing novels and it reminds you to use commas, fullstops and paragraphs. If someone thinks "use paragraphs" is a useful reminder for writing novels, don't you agree he needs to go back to school to learn writing? -- OliverChung
Sorry, but good books about software development are rare and should be treasured. Just because a book says something you already know, doesn't mean you don't need reminding, or that there aren't gaps in your knowledge, or that it isn't helpful to see debatable things that are reiterated. "Use paragraphs" is a simplistic view of it. How many sentences in the paragraph? How is the paragraph structured? Should it be separated by blank lines? How many blank lines and where? Given that it can be done properly multiple ways, what is the most optimal proper way? For strong programmers, it's helpful to fill in bits or remind you. For weaker programmers, any book on good code style is valuable. Writers keep an MLA handbook for reference, though they know most the guidelines by heart. That's how CodeComplete
is - a guide for things every programmer should know, so of course some of it will be redundant. The question is if you really
know it all, or are just pretending to have perfect style.
Note I am not saying the whole book is useless, the section on design, coherence, etc is not bad. I was just commenting on the coding sections, and really, I am quite disappointed after seeing the great book comments and then reading the book. Does any competent
programmer still need to be reminded to limit variable scopes? Or don't use uninitialized variables? Or don't use floats when you want integers? Or that while() loops may execute zero times? This is not a "for dummies" programming book, the coding section is just so much more elementary compared to other sections. Maybe the "go back to school" comment is just too extreme. If you think those elementary part should be included for completeness, I disagree and let's leave it at that. Again, many sections of the book is good, but some parts are really quite outdated and painful to read. -- OliverChung
Oliver, bear in mind that there are at any given time many programmers who are
still in school, and have not yet learned what you have. You say, "It is a pain to read [this stuff] after spending a few years reading this Wiki" Good! Now, what about the legions of developers who haven't
spent years reading this wiki? No competent
programmer still needs to be reminded to limit variable scopes, but you'd be amazed how many incompetent programmers there are in industry.
I'll second that. I'd say around 80% of the programmers in the industry are incompetent. Too many people jumped on the bandwagon because of the high wages in the 90's. Most of them are horrible at it and don't even know what scope means.
(And those people have no use for any programming book, much less this one. BTW, who is the unknown commentator here?) -- JohnPfersich The claim that incompetent programmers have no use for any programming book is patently absurd.
Etc, and so forth. I'd not hesitate to recommend this book, even if it is 10 years old, to anyone entering
the profession this year. By the way, have you considered the possibility that the existence of this book has played a part in the contents of the book becoming common knowledge? Wouldn't it be great if all the other great programming books could obsolete themselves in the same way?
Well put. Did you notice I already said "Still, I think it will be good for beginners though" on my first comment? Seems that we are in ViolentAgreement
here. Let hope some helpful WikiGnome
can summarize a useful review here. -- OliverChung
I would recommend that anyone considering a purchase wait a short while and buy the 2nd Edition, which is pretty much a complete rewrite and all the better for it. The edition embraces OO, which is nice, and references Agile and XP with a balanced view, although he seems to be at pains to show where he already showed the way to XP in CC1. Which I won't argue about, but I sure missed part of that message the first time around. -- MikeWoodhouse
I found it quite poor. Though the author pretends to have a balanced view, he seems to know only five programming languages and they are pretty similar (C, Pascal, Ada, Basic, Fortran). The most complex language feature used is the loop, the most complex data structure the array. Most tips are only applicable to C and only of value if you're cursed with a poor compiler. All in all not a very useful read, I skimmed many chapters because I couldn't bear reading through all the trivialities any longer.
I really don't understand why people care more about the programming languages than the ideas. In fact, you don't even need to look at the code sample to get the idea. This is one of the most excellent books whose many ideas are still very fresh until now. -- BDory.
This is not a book to get "information" from, it's not a book you extract data and technical know-how from. It's a book you read to absorb its attitude and approach. In many ways it reminds me of the advice in ZenAndTheArtOfMotorcycleMaintenance
, which isn't very informative on Zen or motorcycle maintenance, nor on philosophy, but still has valuable things to convey about attitude, both in what's said and in the tone of what's said.
I loved the book at one point. Then years later I read it again, or tried to, and could not, seemed so brain dead. What I think is the problem is that the latest addition is watered down, and some of the original advice, though not new to experts, was great for newbies. In fact, most jobs I go to, many in the team should be given this book. For example, the section on BooleanVariables?
is still applicable today. -- JosefB
I thought it said the same things as ThePragmaticProgrammer
but took a lot more time doing it. --AaronRobson