3 ms·
> It's astonishing how many developers rely on logging/print statements for debugging. One reason is that you don't switch contexts if you insert a print state
by bachmeier 7y ago
> It's astonishing how many developers rely on logging/print statements for debugging.
One reason is that you don't switch contexts if you insert a print statement in your code. I personally find that to be the least distracting way to debug.
- porknubbins 7y agoI’ve tried using GDB and respect those who can, but when I am debugging my short term memory is generally full trying to understand the program code and trying to remember GDB commands clobbers that.
- jakear 7y agoIn something like VSCode (/any other IDE) you can just hit a keybinding or click the little button just to the left of the line to add a breakpoint; all the runtime info is shown in the sidebar and the debug console is shown where your terminal normally is; and the process to run is often the same as the process to debug. So context switching isn't as big of a deal. But still, print statements definitely have their place. (Disclaimer: I work on VSCode)