When something breaks, the first instinct is often to change the code immediately.
But one habit helped me debug much faster:
I try to reproduce the bug in the smallest possible example.
Instead of looking at the whole project, I isolate the problem.
Sometimes this alone reveals the issue.
And even if it doesn’t, debugging becomes much easier when the problem is reduced to a few lines of code.
Simple trick, but surprisingly effective.
After long debugging sessions, I also try to step away from the screen for a bit and switch my brain to something lighter. Sometimes that means a short break with online entertainment like spinbetter hu.
Do you have a debugging habit that helps you?
Top comments (0)