Home

About

Advanced Search

Browse by Discipline

Scientific Societies

E-print Alerts

Add E-prints

E-print Network
FAQHELPSITE MAPCONTACT US


  Advanced Search  

 
I see many of you wasting large blocks of time on debugging. As you already know, the requirements of this class are such that you cannot afford to waste any
 

Summary: Debugging
I see many of you wasting large blocks of time on debugging. As you already
know, the requirements of this class are such that you cannot afford to waste any
time. Below are my suggestions for debugging.
1) After you finish entering your code, get a printed copy and read it. You are
not looking for syntax errors, but for logic errors. This simple practice can
save you an hour of debugging per program. You can find several mistakes
in a few minutes. You see the "big picture". Once an error occurs, you often
spend all your time looking at where you think the error is rather than seeing
how the pieces fit together.
2) Learn to use the debugger provided with .NET. It is really essential and will
save you hours of time. I know it will take you an hour or so to become
proficient with it (that should have happened long ago), but it is time well
spent. If you are using a compiler without a debugger, trash it. I'm serious. It
is not worth your time.
3) Do not try to do all debugging from the debugger. Debuggers are great for
giving you a snapshot, but to see the whole picture nothing beats print
statements. Insert print statements at key points to tell you what parameters
were passed, what values were read, what is the content of the data structure
at a given point in time. These print statements help you to get the global

  

Source: Allan, Vicki H. - Department of Computer Science, Utah State University

 

Collections: Computer Technologies and Information Sciences