Printf Debugging and Srinivasa Ramanujan

11 minute read     Updated:

Adam Gordon Bell
Adam Gordon Bell

This article teaches advanced debugging techniques. Earthly improves debugging with reproducible and parallel builds. Check it out.

The Visual Studio debugger is fantastic. When I was a C# developer, I used it all the time.

Visual Studio Debug Session

A typical pattern was putting a breakpoint on a failing assert in a unit test and then just poking around. I would look at all values in the current scope and see if anything looked wrong. Then I could drag the execution point around in the unit test and step into and out of the code under test.

I would do this pretty quickly without really thinking much about the problem at hand, and I could usually find my way to where the problem was. Of course, it might take me some time to find the problem, but often I could find it iteratively and a bit mindlessly by just using the debugger keyboard shortcuts to walk around the code.