3 ms·
> It's current year! But in all seriousness. Using a debugger can be useful, and even though I've given it a try numerous times, I mostly avoid it because it d
by xdennis 3y ago
> It's current year!
But in all seriousness. Using a debugger can be useful, and even though I've given it a try numerous times, I mostly avoid it because it doesn't fit the way I think.
Debugging is about searching for the source of the problem. With print debugging I'm always leaving behind breadcrumbs which I can inspect all at once at the end. If I'm going down a wrong path I delete the wrong ones and add new ones until I find the issue.
With a debugger I have to mouse around, put breakpoints, run the code, inspect where I'm at, step through, decide that this breakpoint is useless, and have to have all this state in my mind. If I get lost, I have to start from scratch.
Print debugging matches my way of thinking much more.
- SAI_Peregrinus 3y agoLogpoints! They're like breakpoints, but they don't stop execution. And they don't require whatever you're writing C for to have any sort of console output. Of course you do need to have a debug port enabled, which often isn't the case for production hardware so you get stuck printf debugging by blinking an LED and probing it with a logic analyzer. Royal PITA.