April 29, 2016
Whether you’re a new coder or a seasoned programmer, encountering bugs are almost inevitable in tech. They appear when it’s least convenient to the programmer, and dealing with them can be difficult – especially if you’re unsure of how they got there in the first place. But, instead of viewing bugs exclusively as a problem, is it possible to use them to your advantage? Can we actually learn from our bugs?
One software developer argues: yes.
Over on his blog, Henrik Warne explores the idea that bugs aren’t all annoying problem, but a fascinating and unexpected key to solving common coding problems. Whenever he encounters a particularly interesting or complicated bug, he explores the idea of how it can help him become a better software developer and programmer.
So, what method does Warne follow to learn from his bugs? It’s rather simple – he writes a short description of the bug, including all known facts about it, and the lessons learned from it. In the post, he describes how he is able to catalogue all of the bugs he encounters in this way:
“I have a plain text file called bugs.txt. At the top of the file is a template with all the headings, but no information filled in. When I add a new entry, I copy the template section, and paste it in just below the template. Then I go through and fill in the information. Most of the fields shown in the example above should be self-explanatory.
It’s important to note that this is not a bug tracker. And I don’t add all bugs I fix. For example, if I just forgot to add a statement in the code, and as soon as I try it I realize what the problem is, I don’t add an entry. It is only when the bug, or the fix, or the debugging of it was particularly interesting that I add a new entry. Usually, I caused the bug. But occasionally, especially when hunting down a difficult bug over many days, I will add an entry even if I didn’t cause it.
Once a bug is fixed, my first reflex is to breathe a sigh of relief and move on. However, I try to write the entry immediately after it has been fixed. That’s when all the details are still fresh in my mind. Waiting makes it much harder to remember exactly what happened (or I forget to write an entry at all).”
But the question remains: why should you care to catalogue your bugs in this way? It’s easier to learn when the bugs are approached from a different angle. The act of writing works for Warne, as it helps him to retain more information that way. Having this system of recollection is also handier to go back and remind himself on the lessons learned.
The next time you encounter a bug, try to approach it from the angle of wanting to learn from the situation. Though this approach may not work for everyone, there’s still so much to be gained from utilizing different solution methods to solve a persistent problem.
Photo: Flickr / Dino Latoga
Did you like this article?
Get more delivered to your inbox just like it!
Sorry about that. Try these articles instead!