Perhaps the most straightforward debugging technique is simply taking a close look at your code to see whether you can find the problem. If you're lucky, the error jumps right out and you can quickly correct it.
Notice I said "If you're lucky." That's because often you discover errors when you have been working on your program for eight hours straight, it is 2:00 a.m., and you are running on caffeine and willpower. At times like that, you are lucky if you can even see your code, let alone find the bugs. Thus, don't be surprised if examining your code alone doesn't expunge all the bugs it contains.
Was this article helpful?