DEV Community

Discussion on: How do you debug?

Collapse
 
ferricoxide profile image
Thomas H Jones II

There's really seems to be two contexts, here: one is "code I've written" and the other is "code written by others".

In the former case, I tend to implement with a large number of possible break-points built in. Basically, the more break-points you have, typically the less code you have to look at when someone comes knocking months to years later when formerly working code no longer works when used under new conditions.

In the latter case, I tend to modify code only in the area where I think the issue is occurring. The inherent problem with modifying code that's already broken is that you potentially muddy the waters by doing so: every change you make has the possibility of helping isolate the problem, each change also carries the possibility of further masking the problem you're trying to find. So, best to be conservative in where you make modifications.