Pages

2.08.2016

Debugging with certainty

One of the things I've been trying to learn lately is how to debug. I've always dreaded the thought of debugging someone else's code as there's no documentation, or their code is terrible, or I'm dumb, or all of the above. I'll say to myself "there's not much that I can change if those are the reasons, other than damning my luck". But that's no solution.

After talking with a very brilliant co-worker and friend, he suggested me to watch this talk. He knew I'd bite instantly as the speaker is a Clojure developer and I'm a Lisp fanboy. I have to say that I loved the talk but for a deeper, less obvious reason. I'll explain.

Debugging with the Scientific Method gives you certainty in an uncertain situation. Those familiar with psychology will agree with me that there's nothing the mind avoids the most other than uncertainty. Not knowing what to do or where to go makes you feel uncomfortable and, if you are prone to it, panic. Under such circumstances, one of the responses is to flee. Quit. Surrender. Give up. Probably try tomorrow?

Having a tried and true method to debug (and fix) things is The Silver Bullet. No matter what your problem is, no matter how badly documented or how many sins in your codebase. Follow the process. Carefully. Systematically. It will take time (screw schedules!) but you'll fix it. That's a certainty.

No comments: