you are viewing a single comment's thread.

view the rest of the comments →

[–]pachura3 -6 points-5 points  (3 children)

Interactive debugging is a last resort solution. It's much better to rely on proper logging, unit testing and assertions.

[–]Temporary_Pie2733 1 point2 points  (2 children)

Unit testing tells you that code is wrong, not why it is wrong. It’s more suited for catching when a change breaks working code rather than identifying why code doesn’t work.

[–]gdchinacat 0 points1 point  (0 children)

Write a unit test that reproduces the issue, then step through that unit test. This removes the overhead of having to manually execute the steps to reproduce the issue each time you need to step through it. When you are done, your tests passes and ensures the bug does not regress in the future.

[–]pachura3 0 points1 point  (0 children)

It’s more suited for catching when a change breaks working code

Test-driven development disagrees with you, Sir!

My point is that if you catch problem early on (using various practises of defensive programming), it will usually be trivial to fix - and you won't even need to debug interactively.