DEV Community

Discussion on: What are your debugging tips?

Collapse
 
moopet profile image
Ben Sinclair

You can use any system you like, from scattering logging calls or print statements to a fully-featured debugger. What you're most often doing is watching the state of variables and state data at different points in your code.

You'll think something like, "this is a problem with X, so I should look at things that touch X". The tip here is that if it doesn't immediately jump out at you, then it's probably not anything to do with X and you should start browsing around for anything that looks suspicious. Don't get hyper-focussed on it thinking, "it must be a problem with this or that function".