The Debugging Wall
One of the things that I've learned as a programmer is that you spend the majority of your time reading code. While it is possible that as a developer your sole responsibility is cranking out brand new code, it is more likely that you have a job where there is an existing codebase. Even if your goal is to create new features or applications, it is still likely that you'll be writing tests, working with API's and utilizing libraries. The point here is that if you're a programmer, you're going to be reading a lot of code.
When you're reading code you rarely are gleaning that much information from. It is rare that you can glance at some foreign snippet and immediately know what is going on. Soon after you read code, you end up playing with. Throwing in a print statement or firing up a debugger to see what is happening. Everyone has different methods to how they approach learning about what is happening in a codebase. Personally, I'm someone who uses print statements. Ot her folks like to get things into a REPL, with others setting break points.
At some point though, there comes a point where you are out of ideas. You've followed every code path you can imagine, but you can't seem to find out why the application is doing something that appears utterly impossible. You've hit a debugging wall. It is at this point you separate the good developers from the great ones. I'm convinced that great developers have a knack at endlessly inventing new ways to debug problems. This allows them to not only find answers, but it allows them a better sense of focus as there is always something else to try. At least that is my theory. I wouldn't consider myself a "great" developer. Sure, I read the blogs and program in my free time. The idea of programming as a craft or art is definitely fitting in my vision of the world. At the same time I realize that the mythical EricOS or IonEditor will never see the light of day. The especially rare LPL (Larsong Prog ramming Language) will continue to be a mere glimmer in an exceptiona lly old version of myself. In other words, I'm one of the regular guys that needs to keep practicing.
The big question then is what should be practiced. I've hit a wall more times than I'd like to admit and other than simply asking someone else, it is rare that I find my way out by myself. This might simply be a fact of life, but there is a nagging voice in the back of my head saying that is not the case. Just as there are many different programming models, testing methodology and design patterns, it seems inevitable that there should be a set of debugging practices that help to provide a consistent stream of new insights when looking at a problem. I'm really hoping others chime in with suggestions because I'd love to see what sorts of suggestions people have for getting past a debugging wall.
To help lead by example, one thing that has been helpful getting out of a funk is to start looking at a problem from the other end. For example, if you notice something odd in the output and can't find it looking at the code that does the writing, start from the initial request in the UI and start working your way back. Often times it seems inefficient, but when you're spinning your wheels on a problem, what does it matter if you try spinning them somewhere else in the code.
Hopefully as our field continues to progress, the debugging side of programming will get more attention. The fact that TDD has been such a well received practice, it seems as though debugging could be the next big thing. I for one would welcome the influx of ideas helping me improve the part of my job that seems to always take up the most amount of time an energy. Wouldn't you?