Why Should I Learn About Debugging?

Kiki Prottsman
Kiki’s Corner
Published in
2 min readApr 25, 2022

--

What is Debugging?

The term “debugging” means pretty much the same thing as the term “troubleshooting.” Both are words used to describe the act of finding and fixing issues. In programming (and especially computer science education), the word “debugging” is more common.

Why should I care?

Debugging is critical to programming.

Not all errors are because of typos. Sometimes, there is a fault in logic, or a misunderstanding of how a program (or language) uses instructions. That means it’s really hard to code a perfect program without first finding and fixing several dozen small issues along the way.

The amount of time you spend creating any given game or feature often has a direct relationship to how much debugging there is to be done and how easy or hard those debugging challenges are.

Tell me more!

There’s a very clear set of thought-starters for new programmers when it comes to debugging.

  • What is happening?
  • What’s supposed to happen?
  • What does that tell me?

For example, if you’re writing a program that’s supposed to output [1, 3, 5, 7] and instead it outputs [0, 2, 4, 6], you can draw some pretty certain conclusions about where to look for the mistake. Someone might have initialized a variable to 0 instead of 1; added to the variable after printing instead of before; or accidentally added to the variable somewhere between the initialization and the loop.

Another great way to start the debugging process is to look at how the program runs:

  • What is the last step that you know runs correctly?
  • What is the first instruction that produces something incorrect?
  • What happens in between those two points in your code?

A “debugger” is a very helpful tool for answering those questions…as is the addition of a handful of printing statements to shout out values of specific elements in important places. You can find more info on those techniques in my earlier blog: Hunting Bugs — Debugging and Troubleshooting in MakeCode Arcade.

In Conclusion

Debugging can’t be removed from the process of coding, and the more you enjoy solving puzzles, reasoning through logic problems, and hunting bugs, the more fulfilling the whole process will be!

--

--

Kiki Prottsman
Kiki’s Corner

Kiki is an author, educator, and the Director of Education for Microsoft MakeCode