4 ms·
This should be a non-debate. A debugger is for when you want to inspect local state in detail. That can indeed often be very useful, and they are sophisticated
by da39a3ee 6y ago
This should be a non-debate.
A debugger is for when you want to inspect local state in detail. That can indeed often be very useful, and they are sophisticated technology.
However, the people who think that a debugger is the only way to debug just aren't good programmers: often you want a picture of the overall behavior of your program. As has been said by someone other than me, a debugger allows you to fix a bug; print statements allow you to think about the right fix for a bug.
- saagarjha 6y agoPerhaps the people using a debugger have it set so it can give them a picture of the overall behavior of your program.
- da39a3ee 6y agoI think that's just playing with definitions. Correct me if you think this is wrong, but for most people in this thread: "debugger" := a thing that pauses and allows you to inspect the local stack frame, and step into/over, evaluate code in the frame context, etc. "print statements" := any technique involving letting your program run to completion and having it output debugging information to screen or file for examination after it has finished.
- saagarjha 6y agoOne of the things a debugger can do is print things once it hits a breakpoint and continue execution automatically.