Couple of days ago we interviewed a young adept of the craft. We let him code but he got stressed out a bit and wrote very complicated code. At some point he stopped understanding the code he wrote. So he started using debugger to figure out the meaning of the code. This is when debugger became sort of a modern electronic translator.
The thing is we probably don’t want to use debugger as a translator. We prefer to understand the code we write. Instead of debugging I usually recommend writing a small test that covers the logic in question. You can try this exercise next time you are about to launch the debugger.
Don’t get me wrong – debugger is a handy tool in every developer’s kit. It’s just the less you use it the better you are in producing high quality code. Actually, it’s probably other way around – when you get fluency with TDD/simple design you will soon discover how rarely you use debugger.
Amen. The debugger should be the last tool you pick up not the first.
Пора переименовать блог, присвоив название связанное с доменами :) может хватит про них?
Indeed, I was discovering the same thing recently. The more I focus on writing tests, the less I use the debugger.
Помнится, кто-то выкладывал фотки…
Couldn’t agree more… when I see somebody writing code and firing it up in a debugger, I know there is going to be trouble…