Practical .NET

Insider: Secrets of Debugging

Faced with reviewing large swaths of other people's code, Peter Vogel is left to ask: what does it really take to be good at debugging?

Even with following a Test Driven Development regime, my code doesn't work the first time (pretend you're surprised). So debugging is a critical skill for me. Also, as a hired gun, I'm frequently having to deal with someone else's code, which often isn't working the way everyone expected it to.

One thing I have noticed: I'm better at debugging than a lot of the people I work with. My first step is to look at the evidence to make sure that I know what the problem is. A lot of people seem to feel that the first step is to SOLVE THE PROBLEM. They look at some of the symptoms, assume that they know what the underlying problem is and then start implementing a solution -- which usually means that we end up with two problems where we originally only had one. But I've already written about what I consider the essence of the debugging technique (getting a good description of the problem) and the mental tools for achieving that goal. Feel free to read it and disagree.

Lately, however, I've been reviewing a large whack of code with an eye to improving its quality and performance. That means that I've been reviewing my debugging and analysis toolkit. And that's led me to writing up some of the resources that you have available in the .NET/Visual Studio environment and may not be aware of. Those topics are so short that they don't really belong in this forum, so you'll see them turning up as weekly tips in my .NET Tips and Tricks blog over the next few weeks.

But I wonder: Can people learn to "debug better?" Or are some people just good at debugging and every else is just good at generating bugs? You tell me.

About the Author

Peter Vogel is a system architect and principal in PH&V Information Services. PH&V provides full-stack consulting from UX design through object modeling to database design. Peter tweets about his VSM columns with the hashtag #vogelarticles. His blog posts on user experience design can be found at http://blog.learningtree.com/tag/ui/.

comments powered by Disqus

Featured

  • Visual Studio Code Dev Team Cleans Up

    The Visual Studio Code development team focused on some housekeeping in the October update, closing more than 4,000 issues on GitHub, where the cross-platform, open-source editor lives.

  • ML.NET Model Builder Update Boosts Image Classification

    Microsoft announced an update to the Model Builder component of its ML.NET machine learning framework, boosting image classification and adding "try your model" functionality for predictions with sample input.

  • How to Do Naive Bayes with Numeric Data Using C#

    Dr. James McCaffrey of Microsoft Research uses a full code sample and screenshots to demonstrate how to create a naive Bayes classification system when the predictor values are numeric, using the C# language without any special code libraries.

  • Vortex

    Open Source 'Infrastructure-as-Code' SDK Adds .NET Core Support for Working with Azure

    Pulumi, known for its "Infrastructure-as-Code" cloud development tooling, has added support for .NET Core, letting .NET-centric developers use C#, F# and VB.NET to create, deploy, and manage Azure infrastructure.

  • .NET Framework Not Forgotten: Repair Tool Updated

    Even though Microsoft's development focus has shifted to the open-source, cross-platform .NET Core initiative -- with the aging, traditional, Windows-only .NET Framework relegated primarily to fixes and maintenance such as quality and reliability improvements -- the latter is still getting some other attention, as exemplified in a repair tool update.

.NET Insight

Sign up for our newsletter.

Terms and Privacy Policy consent

I agree to this site's Privacy Policy.

Upcoming Events