The War on Debugging and Why you should remain calm and debug anyway
In my sales career, we were told to avoid discussing politics and religion. That is good advice.
Working in software, I have found other hot-button issues.
For instance, there were many Java vs Microsoft debates early in my career. I won’t say anything about tabs and spaces…
Debugging is Bad
I have noticed a lot of shade thrown on debugging. The gist is that only inexperienced dolts use them.
Here is a loaded question. In this question, they ask if real programmers use debuggers. Of course, there is the typical dogpiling.
Debugging Needed
Here are a few places where a debugger is helpful.
New code
Anytime you have to learn a new codebase debugging can be enlightening. What is the naming convention? Simple names can be initially confusing. I saw something named somethingCodeCode and I laughed.
Poorly written
Have you ever noticed the code you wrote six months ago seems terrible? I have thought, “What was I thinking many times.”
Thank goodness we live and learn. Keep learning and be empathetic to the previous developer, even if it was you.
New language
I have been learning Vue.js. It has been a fun challenge. Picking up a new language can be tricky. The debugger helps you find out what is going on.
No Debugger Needed
There are times when you don’t need a debugger too.
Clean code
I have long been a fan of the book Clean Code. If your team is using these principles it would minimize the need for a debugger.
The names of objects make sense. Another benefit is there are little to no comments needed. The code documents itself.
Follows standards
Organizations that enforce coding standards help too. This creates an application that works in a typical fashion.
However, I have seen this fall apart too. When someone leaves the standards can be abandoned.
Experience
With my years of experience in Java, I usually don’t need to debug unless we are using some new dependency.
This also goes with domain knowledge. I recently started working at a healthcare company. That is a different domain for me. Others who have been in the field can understand things fine.
Considering everything, we can see there are times to use the debugger. No, it is not a silver bullet. Whether you are learning a new language or combing through some new codebase it can open your eyes.