Do You Use a Debugger?
Sandor Dargo's blog post reflects on his journey with debugging in C++, highlighting the transition from using debug statements to employing debuggers due to increasing code complexity in new job environments.
Read original articleThe blog post by Sandor Dargo discusses the use of debuggers in C++ programming, reflecting on the author's personal journey with debugging practices. Initially, Dargo did not use a debugger due to a lack of knowledge and relied on debug statements to trace code execution. Over time, as he became more proficient in writing clean code and implementing test-driven development, he found that debug statements were often sufficient. However, after changing jobs and encountering a more complex codebase, he realized that relying solely on tests and debug statements was inadequate. The complexity of the new system necessitated the use of a debugger to effectively understand and resolve bugs. Dargo emphasizes the importance of adapting to the demands of different codebases and acknowledges that while some developers may not use debuggers, the intricacies of modern software often require their use for efficient debugging.
- The author initially avoided using a debugger, relying on debug statements instead.
- As coding skills improved, the author found debug statements sufficient for simpler codebases.
- A transition to a more complex codebase highlighted the limitations of not using a debugger.
- The post underscores the necessity of adapting debugging techniques to the complexity of the code being worked on.
- The author reflects on the evolving nature of software development and debugging practices.
Related
How to build highly-debuggable C++ binaries
David Hashe's article offers guidance on configuring C++ toolchains for better debuggability, emphasizing practices like enabling sanitizers, using debug modes, and balancing performance with debuggability in large projects.
Thoughts on Debugging
The article emphasizes the importance of reproducing issues in debugging, effective communication, logging for real-time analysis, clear documentation for recognition, and warns junior engineers about the absence of favors in business.
Kernighan's Lever (2012)
Kernighan's lever highlights that while clever coding can complicate debugging, facing challenges fosters skill development, making debugging a valuable learning opportunity that enhances programming capabilities.
Mastering Ruby Debugging: From Puts to Professional Tools
Ruby developers must master debugging to fix code issues effectively. The article discusses tools ranging from simple puts statements to advanced debuggers, emphasizing the importance of understanding operator precedence.
Printf Debugging Is OK
Alex Dixon highlights the programming community's debate on IDEs versus text editors, noting junior developers' lack of debugging experience. He advocates for various debugging tools and methods to improve skills.
Myself, I think tests and debugging go together like peanut butter and jelly. That is, you use tests to set up a situation you want to debug, then you run the debugger. When you're all done you have a test that proves the bug was fixed.
It might be less of a problem in the C++ world but I really like being able to use the debugger to investigate a situation without touching the source code at all, since if you start hacking on the source code to add printfs and add other debugging hacks you often wind up checking in things accidentally that you shouldn't have, particularly when you're also making real changes to fix the bug.
An arXiv paper [1] investigates those accidental commits and reveals that people do a lot of printf debugging of async callbacks since those can be hard to debug; they breakpoint just find in most environments but you never really know if they are going to run or not and I think a lot times they get called N times for harmless things before you get the one you want to breakpoint. (Maybe it's just me but I've never had good luck with conditional breakpoints)
Debugging is not really about the software, after all; it's a process of discovering the limits of your own understanding and identifying the flaws in your mental models. You make hypotheses and test them, and it doesn't matter so much what instruments you use to perform the tests, so long as you know how to think about the process systematically.
Same for version control, linting, and formatting, I pretty much ignore technologies that don't integrate with all the modern dev tools most of us expect to have.
Related
How to build highly-debuggable C++ binaries
David Hashe's article offers guidance on configuring C++ toolchains for better debuggability, emphasizing practices like enabling sanitizers, using debug modes, and balancing performance with debuggability in large projects.
Thoughts on Debugging
The article emphasizes the importance of reproducing issues in debugging, effective communication, logging for real-time analysis, clear documentation for recognition, and warns junior engineers about the absence of favors in business.
Kernighan's Lever (2012)
Kernighan's lever highlights that while clever coding can complicate debugging, facing challenges fosters skill development, making debugging a valuable learning opportunity that enhances programming capabilities.
Mastering Ruby Debugging: From Puts to Professional Tools
Ruby developers must master debugging to fix code issues effectively. The article discusses tools ranging from simple puts statements to advanced debuggers, emphasizing the importance of understanding operator precedence.
Printf Debugging Is OK
Alex Dixon highlights the programming community's debate on IDEs versus text editors, noting junior developers' lack of debugging experience. He advocates for various debugging tools and methods to improve skills.