Announcement

Collapse
No announcement yet.

Book review: Code Complete 2nd edition

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Book review: Code Complete 2nd edition

    I recently read the book Code Complete 2nd edition. It had a lot of interesting bits that I've seen people ask about in this forum (coding style and layout, choice of language, a whole section on the debated "goto" statement, etc..)

    It was a fantastic book for me, but I work on software for a career, some parts would be pretty heavy for somebody who is just taking a class where they need to do coding and will never do coding again.

    The book is really well laid out in larger sections:
    Part I: Laying the Foundation
    Part II: Creating High-Quality Code
    Part III: Variables
    Part IV: Statements
    Part V: Code Improvements
    Part VI: System Considerations
    Part VII: Software Craftsmanship

    It doesn't do justice to the secionts in those parts, but this book covers *everything*. How to name variables, how to use them, how to debug software, control structures, etc. It isn't specific to a programming language, most of it is very general and applies to programming in general. The code examples are are in Java, C++ and Visual Basic, but they just illustrate a concept. The book is very well written in that it is entertaining to read, i.e. it doesn't put you to sleep, the author does a good job.

    This is a fantastic book, the reviews online are very good. Anybody who does a lot of programming should have a look at it!
    Interested in a chance to win free VIP? Click here!

  • #2
    I have skimmed through that book a few years ago. There are some useful content in thater and is still relevant however there is a bunch of content that is either irrelevant these days or just plain common sense.

    If we look at the goto statement itself, it is not used that much in most of the recent languages even if the command is available. Most people believe that with less usage of the goto statement, you get better and cleaner code where you don't jump from one part of the code to another.
    Also, with most of the static code analysis tools, the programmers job has become more easy to spot and fix issues even if they are a little sloppy. Not that I am encouraging sloppiness but the tool have come a long way in increasing the programmers prodcutivity.

    All that being said, I still have this book on my bookshelf and one of these days when I have some free time I might skim through it and see what I learn out of it.

    Comment


    • #3
      Goto is interesting. I see programmers use an equivalent quite frequently in new code, i.e. a loop that won't execute more then once which you just break out of:

      do {
      ....
      if (error) break;
      ....
      if (error) break;
      ...
      while(0);


      That is the same as:

      ....
      if (error) goto finished;
      ...
      if (error) goto finished;
      ...
      finished:


      I thought it was a fantastic read. Most if not all of the book is still relevant. When you mention common sense, so many books are common sense, yet why do people not apply it? At a higher level, projects are always run the same way, it seems quite common that in the software industry it seems we don't learn from our mistakes! :) Almost all software projects are late and over budget and features need to be cut to finish the project! Yet there is a bunch of litterature that identifies the problems and solutions!
      Interested in a chance to win free VIP? Click here!

      Comment


      • #4
        I do agree that there different ways of implementing the same logic. I should have reworded my statement a bit better the last time. I have not used goto & break statements in the last few years. Whether it is just my personal preference or the less need for those statements in OO languages is something I need to ponder about. I still think it has more to do with the small methods that do a single job that are written as part of the OO languages.

        I also agree that Software projects can tend to get costlier than planned and run out of schedule which is the main reason for the advent of Agile Programming/XP. My current company has adapted the Agile programming style (fail-fast approach) 5 years ago and this has helped us tremendously with project estimates and costs.

        Finally, I read this book approximately 10 years after I entered Software development career which can be a main reason for me to feel that most of the book is common sense information.

        Comment


        • #5
          At least it generated some discussion! Maybe now some other forum members can get a hold of the book, read through it and post their thoughts!

          I agree, once you are experienced, there is less return on reading through these books. However, you can find a few good ideas here and there. Or sometimes, it just reminds you to apply something you already know!
          Interested in a chance to win free VIP? Click here!

          Comment


          • #6
            Re: Book review: Code Complete 2nd edition

            CC is a good book. I have the same & another related one - Writing Solid Code.
            These books are really good at the time when you are starting your dev career.
            They provide great insights into good practices.

            Comment


            • #7
              Re: Book review: Code Complete 2nd edition

              I have bought at least 4 copies of the 1st edition and given them to people I work with in hopes that they'll read it.

              Comment

              Working...
              X