top | item 42220980

(no title)

dhashe | 1 year ago

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.

discuss

order

No comments yet.