Classic Coding Tome Updated 48
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."
Re:Why? (Score:4, Funny)
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).
Re:Missing Something? (Score:4, Insightful)
You are correct, sir. (Score:1)
What level is this appropriate for? (Score:2, Interesting)
Re:What level is this appropriate for? (Score:5, Informative)
Excellent for the self-taught... (Score:2, Interesting)
I suppose if you had a professors, cow-orkers, or friends that you could learn this book wouldn't be as useful.
I keep the book is nearby on the 'top shelf' of my bookcase. I don't use it much anymore, but it and 'the Pragmatic Programmers' are among the books that most influenced me as a programmer.
Re:What level is this appropriate for? (Score:3, Interesting)
Well, how serious are you about software development? I'd answer "yes", but it depends on how rich you are in time and money and where you're going.
I did have some reservations (or minor nits) about the original, would be interesting to hear if these have been addressed:
Re:What level is this appropriate for? (Score:1)
Once you have some programming under your belt, this book will give you many best practices and, as another poster comments, will give you the reasons for those best practices. Programming lore is all very well, but this book gives solid evidence for why. Example, the sections on code structuring and indentation backup the recommendations with solid evidence and examples of how readabilit
Pair Programming. (Score:3, Interesting)
I read the previous edition, and my feeling then was that it, between the lines, sang the gospel of Pair Programming. Anyone else got that impression? I don't think it was ever mentioned specifically in that edition, though I could certainly be wrong on that.
Re:Pair Programming. (Score:1, Troll)
Re:Pair Programming. (Score:4, Interesting)
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.
Re:Pair Programming. (Score:1)
Re:Pair Programming. (Score:1)
I read that book but I didn't get that impression. Code Complete certainly emphasizes the importance of code reviews. Pair programming is not really a code review although I can see how you might think of it as a code review while you type. Real code review should happen after the programmer thinks that (s)he is done.
Great book,,, (Score:4, Interesting)
Many obvious statements (Score:2, Insightful)
To me, the book looks like a big disappointment. I downloaded Chapter 5. There are numerous obvious statements like these:
Design Is About Tradeoffs and Priorities
And:
How to Attack Complexity
Overly costly, ineffective designs arise from three sources:
A complex solution to a simple problem
A simple, incorrect solution to a complex problem
An inappropriate, complex solution to a complex problem
Re:Many obvious statements (Score:5, Interesting)
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.
Re:Many obvious statements (Score:3, Interesting)
Cons:
- It limits the block nesting level within a proc.
Pros:
- It limits the block nesting level within a proc.
- It makes it hard to misread the indent.
Re:Many obvious statements (Score:4, Interesting)
As I was typing the post my first thought was of this particular convention in the Linux kernel code. The rule to follow there is to stay consistent with the existing body of code. But FYI, here's the relevant bit from the first edition of Code Complete:
So while the Linux kernel code may indeed aesthetically prevent the bad coding practice of deeply nested C code, it likely runs the risk of being harder to understand. Once again, this is the sort of thing I always thought was cool about the original book. It ascends above religious wars with hard data, while clearly identifying the whole subject as a religious issue... there's a little cartoon sign in the book at the beginning of that chapter.
Re:Many obvious statements (Score:1)
Then again, maybe a test would prove me wrong. That's why I'd like to see a sample
Re:Many obvious statements (Score:1, Informative)
Miaria, Richard J., et al. 1983. "Program Indentation and Comprehensibility" Communications of the ACM 26, no 11 (November): 861-67
Re:Many obvious statements (Score:1)
Re:Many obvious statements (Score:1)
Re:Many obvious statements (Score:3, Insightful)
Use of Tabs (Score:1)
Re:Many obvious statements (Score:1)
It's obvious that indents should be no more than 4 spaces and no less than 2 spaces
You.. insensitive clod!
Testimonial (Score:4, Informative)
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.
Re:Testimonial (Score:1)
Other good books? (Score:2)
Is UML useful? How about books on secure programming? Are design patterns a good tool? Will learning things like assembly or Lisp teach me anything useful?
Re:Other good books? (Score:1, Insightful)
If you wanted the body of an olympic swimmer would you practice basketball or swimming?
Maybe you are asking the wrong question. Maybe you want ot be good at proj. man. or theoretical CS.
Getti
Re:Other good books? (Score:1)
All of these (well, I don't know UML, and I am only planning on learning patterns) are useful. I'd especially reccomend learning LISP and assembly. LISP will teach you new methods of abstraction above and beyond OOP, as well as "programmable programming language" ideas that can be used to understand language-writing with less pain. (For more on why LISP
Re:Other good books? (Score:3, Insightful)
Is UML useful?
It depends on what you mean by "useful." If you're working in a shop that requires UML, and you need to communicate with people, then it's useful. The big problem with UML is that a truly bad design looks just the same as a good design. A much better test of the quality of design is to describe it in English. If it can't be done easily, then it's probably a bad design.
How about books on secure programming?
I haven't met any of these that I like. There are lots that tell how to sec
Re:Other good books? (Score:4, Interesting)
Design Patterns, as was mentioned here already is a *must have* (IMO) for any developer, even if you're coding Cold-Fusion scripts all day. After all, there are other ways to take advantage of the object-oriented philosophy w/o an OO language.
UML is a great communication tool (language), but it can't do everything, even though it tries. Ultimately, it really just helps standardize the world of bubble-drawings, inheritance diagrams and object interaction sketches and use-cases that everyone used to publish before 1995.
IMO, a referece is only as good as you find yourself opening it, and a langauge like this only as good as those around you understand it. I'd reccomend a good lightweight reference and mabye a tutorial or three to get familiar with the bulk of UML. The reference will come in handy later when you encounter symbols or diagrams that you may need to translate/learn quickly. UML, in its entirety is a very deep topic with a lot of ground to cover, so be prepared for a time investment if you want to go for the whole thing.
Outside of all this, I'm afraid the truely advanced stuff is all hiding away in the ACM's conference archives, the IEEE's archives and innumerable studies and papers from CS Phd's and the like. A lot is available online, but you can still find some concepts and studies that have stood the test of time at the library (Dead Tree Format). Your local University's mathematics section is a good place to start.
Working in another language enough to understand the nuances and advantages to its grammar can do wonders for expanding how you tackle problems. To truely get the most out of a new language, you need to approach it as a cross-training exercise and try to learn what you can from what doesn't cross the language barrier, and carry everything else with you. This is like football players learning ballet: knowing how to pirouette won't get you more touchdowns, but learning balance and grace will help you dodge tackles and blocks.
For example: In the case of learning ASM after C, you'll understand in far more depth the impact of iteration vs recursion and pass-by-value vs pass-by-reference. But if you just learn one language all by itself, for itself, you're not going to acquire the kind of depth and understanding that you seek.
Re:Other good books? (Score:1)
That topic is enough to keep you busy for awhile, and the most important in havi
Re:Other good books? (Score:2)
I wrote an article on my website [zx81.org.uk] about this.
That was a while ago though! I'd also second the recommendation for Pragmatic Programmer and I think Extreme Programming Explained (also reviewed on my website!) is worth reading even if you don't like XP.
--> Stephen
Software Project Survival Guide (Score:4, Insightful)
Used for CS classes (Score:3, Insightful)
The old version of this book was used as a textbook for CS 240 [byu.edu] at BYU, which is an advanced programming /slash/ C++ course.
I find it great that some professor is actually teaching coding standards. Imagine my surprise of discovering JavaDoc commenting after haven taken 3 Java classes and not one of them ever mentioned JavaDoc.
I haven't taken CS 240 yet, but I plan to this fall. I already talked to the professor about the textbooks he plans to use, and he said that if they came out with the new edition (which they did) then he would probably use the new edition for class. This means though that current students with the book now will have a hard time selling the book, and future students will have a harder time finding used book deals on it. I guess I should start saving my college student pennies.
Code Complete (Score:5, Insightful)
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.
my favorite tome (Score:2)