Scholarly Resources for CompSci Undergrads

C Programming Language

Notes about C Debugging (slides 1 to 3)

down to slide 1 down to slide 2 down to slide 3 Forward to Short Example


Slide 1: How to Debug


What is Debugging?

Debugging is what you do to fix your program when it doesn't work. [As opposed to what you do when it does not compile. -- 20 May 1996] The term originated with the first tube computers. Sadly debugging has always been a part of computer programming. Modern programming techniques try to reduce or eliminate the need for extensive debugging of code, by preparing logically perfect programs.

The Best Cure is Prevention

When you come to debug your program, you already know it doesn't work. If you knew before that it didn't work then you could correct it before you began. If you understand your program you will be less likely to make mistakes and be better at correcting them. Write the program so you can understand it. Use comments and simple code.

Is Clarity More Important Than Correctness?

If your program is clear you can make it correct. Can you be sure your program is correct if it isn't clear?


Slide 2: How to Debug


There's never time to do it right, but there's always time to do it again.


Slide 3: How to Debug


To Solve a Problem You Must Understand It

Find the code that generates the problem


Where to next?

These slides

back up to Slide 1 back up to Slide 2 back up to Slide 3

Other slides

Up to List of Contents Forward to short example


http://www.csd.uwo.ca/~jamie/C/Debug/part1.html

Last updated by J. Blustein on 28 May 1996.

This document is copyright by its author, J. Blustein <jamie@csd.uwo.ca>.

HTML 2.0 Checked!