Hacker News new | ask | show | jobs
by orwin 2193 days ago
It really depend on context. I did not use gdb at all before the end of my first year where i had to code my own posix-compliant shell (i don't think it was by the end of the project but we were close).

But gdb helped me understand why printf() was not working as intended, how those pesky register worked, remove memory leaks, and overall taught me a lot, fast. I had to rewrote malloc() using mmap at the start of my second year, i don't think any amount of printf() would've helped me as much as gdb and valgrind did. Also watchpoints basically do the same job as printf most of the time (but are more tedious to use).

I find pdb() usefull too (although it might be because i don't understand python as well as i should). I definitely use print() though, like said in the article, to narrow down where the break points should be placed. And i think than more than half the time i used pdb() it was on my test files, whether it was unit testing or feature testing (those are hard :/), so better test coverage would not help me much.

Also, debugging Common Lisp with (print) is usefull for beginners not used to the REPL, but once you understand how this whole slime/REPL thingy works, not using it to debug is bold.