Find the Root Cause

Debugging is tricky business. You really have to act like a detective and sift through all the clues to discover why your program isn’t doing what it is supposed to do. As you search for the problem, you will often find many symptoms, and you will be tempted to fix those symptoms. I have done this many times, and not once has it been a good idea. Keep digging until you find the root cause of the problem—when you fix that root cause, you will fix all the symptoms at once. A good indication that you are fixing a symptom instead of the root cause is that the fix makes your code messier and harder to work with. For instance, if you have to add a new parameter to one of your functions, you are probably fixing a symptom and not the real problem.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.3.208