Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 13: Debugging

C H A P T E R  13

Debugging

As soon as we started programming, we found to our surprise that it wasn’t as easy to get programs right as we had thought. Debugging had to be discovered. I can remember the exact instant when I realized that a large part of my life from then on was going to be spent in finding mistakes in my own programs.

—Maurice Wilkes, 1949

It is a painful thing to look at your own trouble and know that you yourself and no one else has made it.

—Sophocles

Congratulations! You’ve finished writing your code so now it’s time to get it working. I know. You’re thinking, “I can write perfect code; I’m careful. I won’t have any errors in my program.” Get over it. Every programmer thinks this at one point or another. There’s just no such thing as a perfect program. Humans are imperfect (thankfully). So we all make mistakes when we write code. After writing code for over 40 years I’ve gotten to the point where most of the time my programs that are less than about 20 lines long don’t have any obvious errors in them and lots of times they even compile the first time. I think that’s a pretty good result. You should shoot for that.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial