4 ms·
Not necessarily. I know very well how to use a debugger, but nowadays I just prefer to use prints: it forces to you actually think about what's happening instea
by gjulianm 6y ago
Not necessarily. I know very well how to use a debugger, but nowadays I just prefer to use prints: it forces to you actually think about what's happening instead of just looking at it. It's also more useful in situations where putting a debugger actually changes behavior (high performance systems, parallel programs).
- timzaman 6y agoExactly. And prints are cross platform cross language etc.
- eonwe 6y agoI would expect print-debugging to change the behavior in such cases too. Usually writing to stdout is behind some synchronization so using print debugging will drop performance and make program less parallel.
- gjulianm 6y agoYou can change where to put the prints if they do change the behavior (which incidentally also helps in understanding what's happening). You can print only if a condition happens, or only before/after critical sections, or print counters that you compute in the fast path. With the debugger you're always taking the overhead in and breakpoints will always change the flow of the program.