06-22-2026, 12:45 PM
Debugging is one of those skills that separates decent developers from great ones, and it's rarely taught properly. Most people start with print statements and never really level up.
Here's what actually works for me:
Rubber duck first. Seriously. Explaining the problem out loud - or typing it out for a Stack Overflow question you never post - forces you to articulate assumptions you didn't know you were making. Half the time I solve it before finishing the explanation.
Bisect the problem. If something is broken, eliminate half the possibilities at a time. Binary search applies to debugging. Find the last commit it worked, find the smallest input that reproduces it.
Read the actual error message. Sounds obvious. Most people skim the first line and then Google it before reading the full stack trace. The answer is usually in line 3.
Reproduce it first. Don't touch the code until you can reproduce the bug consistently. Fixing something you can't reproduce is just guessing.
Check your assumptions. Add assertions around the thing you "know" is true. It usually isn't.
git bisect is underused. If a regression crept in and you don't know when, git bisect will find the commit in O(log n) checkouts.
What are your go-to debugging techniques? Language-specific tips welcome too.
Here's what actually works for me:
Rubber duck first. Seriously. Explaining the problem out loud - or typing it out for a Stack Overflow question you never post - forces you to articulate assumptions you didn't know you were making. Half the time I solve it before finishing the explanation.
Bisect the problem. If something is broken, eliminate half the possibilities at a time. Binary search applies to debugging. Find the last commit it worked, find the smallest input that reproduces it.
Read the actual error message. Sounds obvious. Most people skim the first line and then Google it before reading the full stack trace. The answer is usually in line 3.
Reproduce it first. Don't touch the code until you can reproduce the bug consistently. Fixing something you can't reproduce is just guessing.
Check your assumptions. Add assertions around the thing you "know" is true. It usually isn't.
git bisect is underused. If a regression crept in and you don't know when, git bisect will find the commit in O(log n) checkouts.
What are your go-to debugging techniques? Language-specific tips welcome too.
