3 ms·
Concluding that using printf to debug is superior to using a debugger would be a mistake! I’ve been programming in C for nearly 20 years and primarily used pri
by sfpotter 4y ago
Concluding that using printf to debug is superior to using a debugger would be a mistake!
I’ve been programming in C for nearly 20 years and primarily used printf for debugging for the first 12-15 years, and have used debuggers more and more. I use Emacs, and its gud mode is so nicely integrated into everything that using gdb is truly much, much faster than the alternative. I don’t use print debugging at all anymore.
It takes less time and cognitive overhead to just stop the program on the same line you would have inserted your printf, but you can now inspect the entire program state.
Obviously I’m not saying anything revelatory if you use an IDE on a regular basis… I guess this comment is for the folks who eschew IDEs.