DEV Community

loading...

Discussion on: How to Debug Anything

Collapse
murrayvarey profile image
MurrayVarey

Once you have a range of possibilities for what could cause your problem, in some sense, test in the middle of the two. Your intuition for where the problem lies is probably wrong.

There's so much truth in these two sentences! Binary chopping (or searching) has got me out of many a hole over the years -- be it chopping changesets, build versions, or just sections of the code. Crucially, it can -- perhaps should -- be done without intuition or knowledge. Whenever I start a binary search, I'm admitting: "Hey, the pool of possible causes is so vast that I couldn't even guess at what's happening". At this stage, there's one rule: no guessing allowed. Just measure, observe ... and take good notes. Usually, the results are surprising.

Fantastic post, Tim. Thanks!