Member-only story
Is Debugging Hard? Learn How To Make It Easier
Sometimes our mental models don’t map the code at all

It was a judgment day. I had been working on a feature for the last month. That afternoon, my team was to present the work to the CEO.
I felt fairly confident. The day before, a tester reported a few minor bugs — some obvious things to fix during my morning coffee.
One task was to show the companies' logos in a table. Fair enough. But it was weird. I felt like I had fixed it earlier. I even wondered how I could mess up simple logic.
Well, the only one who doesn’t make mistakes is the one who does nothing. I removed one exclamation mark in the code and believed the job to be done.
It wasn’t.
One-and-a-half hours later, I had touched 14 files and changed 250 code lines. I prayed for the fix to work.
Debugging Is Hard
When we started to create computer programs, we instantly noticed we were messing it up all the time. To make it worse, it wasn’t easy to fix our mistakes. As Brian Kernighan put it:
“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as…