3 ms·
There's a difference between general "debugging" and "using a debugger". In my experience using a debugger is generally abused. Students need to learn to modu
by bnolsen 3y ago
There's a difference between general "debugging" and "using a debugger". In my experience using a debugger is generally abused. Students need to learn to modularize and modularize and modularize so that what they write can be unit tested with logic errors detected by the tests. Tossing in quick print statements, compiling and rerunning ends up encouraging better design. When someone can't debug without an interactive debugger generally that means the code has hit ball of spaghetti status.
This becomes especially helpful when writing heavily threaded code as interactive debuggers are almost entirely worthless when it comes to finding and fixing race conditions.
I find I use debuggers for post crash analysis, either unintentional during a program run, or intentionally forced by me. Specific tests designed to crash the system in these cases can be cleaned up and added to the general test suite.