xhtml
 

Run Time Errors

This is more difficult. Some run time errors will report the line number where something went wrong. but that is often a long way from the actual bug. There are several things you can use to help you find bugs.

Whichever of these techniques you use, the actual process of finding a bug is detective work. Don't just try things at random, because your program is likely to get worse and worse, and if it seems the bug is fixed but you haven't properly understood what it was, it may pop up again at any time. Each experiment you do should try to narrow down the problem, e.g. "is there a problem before the program reaches this point, or does it develop after that?"

As always, after a serious attempt, ask someone rather than wasting hours. Neat, logical and well designed code is essential if someone else is going to find your bug. Otherwise, they are likely to say, "well, I wouldn't start from here, if I were you".


Back