I’ve been teaching myself C# for the last 2 years or so. I’ve got a reasonable handle on a lot of the language/ programming in general. However I feel like I’m massively missing the mark when it comes to debugging.
I deal with a lot of multithreaded and real-time applications that interact with physical hardware. I can set breakpoints and inspect variable values at the breakpoint, step into, step over, etc. But the “autos” and “locals” windows are something I don’t understand.
Are there any decent courses/resources that teach me some intermediate debugging skills. Particularly interested in resources that focus on Visual Studio tools (extra points for resources that include tips on VS Enterprises debugging tools, like step backwards, etc.).
Appreciate anyone pointing me in the right direction! I’ve learnt by feel up to this point, but I’ve hit a wall and could use some structured docs or courses.
What if you want to debug tests?
Also, debugging is another form of introspection. Adding a breakpoint and stepping through the code is a way to onboard onto a project and understand how something works. Tests don’t give you that.
Well… I didn’t say “you shouldn’t debug”, I said “[i]f you find yourself debugging a lot […]”. Debugging is a tool in our toolbox and we should use it whenever it’s necessary. But if it’s something we do too often, it may be an indication of a code quality problem (a bad smell, if you like).
If debugging is synonym of troubleshooting than yeah, if we find ourselves troubleshooting code a lot then that’s an indication of a code quality problem.
But debugging is more than troubleshooting.
I meant using the debugger.