News for hackers. Stuff that matters.
Re:Don't Look Down on Print Debugging by dhashe on Saturday November 23, 2024 @09:16AM (#42220980)
Print debugging is a great tool in unfamiliar environments. As the article notes, it’s simple and works everywhere.

I do think that it’s worth learning your debugger well for programming environments that you use frequently.

In particular, I think that the debugger is exceptionally important vs print debugging for C++. Part of this is the kinds of C++ programs that exist (large, legacy programs). Part of this is that it is annoying to e.g. print a std::vector, but the debugger will pretty-print it for you.

I wrote up a list of tips on how to use gdb effectively on C++ projects awhile back, that got some discussion here: https://news.ycombinator.com/item?id=41074703

It is tricky. I understand why people have a bad experience with gdb. But there are ways to make it better.

There are no comments on this comment yet.