2 ms·
> I'll unashamedly admit that I made liberal use of printf debugging while trying to make my way through these code paths Nothing to be ashamed of, imo; printf
by nunez 2y ago
> I'll unashamedly admit that I made liberal use of printf debugging while trying to make my way through these code paths
Nothing to be ashamed of, imo; printf debugging works incredibly well!
- SAI_Peregrinus 2y agoYep. Debuggers are more powerful, they can do everything `printf` debugging can do + more, but take more work to set up. For interpreted languages, they often take more work to use than just adding a print statement & rerunning, for compiled languages the reverse is more likely.
- ivanjermakov 2y agoThere are cases where printf helps but debugging doesn't. Multithreaded code is one of such cases.
- SAI_Peregrinus 2y agoConditional breakpoints that run a script and continue can be used equivalently to printf debugging, just set it to print when the selected line is hit. You can do this without restarting the application, even for multithreaded code. Also watchpoints, for the equivalent but at a memory location instead of a code line. Debugger != breakpoints.