Debugging Is a Reasoning Problem
Debugging becomes much easier when you stop guessing and start treating every failure as evidence.
Expected versus actual
The first question in debugging is not how to fix the code. It is where reality diverges from the mental model.
The earliest incorrect assumption is usually more useful than the final error message.
debug.tstypescript
console.log({
expected,
actual,
});| Stage | Question |
|---|---|
| Expected | What should happen? |
| Actual | What happens? |
| Evidence | What do we know? |
| Hypothesis | What explains the difference? |
- Reproduce the failure.
// RECENT ARTICLES
01
What Actually Happens When You Visit a Website12 Sept 2026
→02Server Components Changed How I Think About React10 Sept 2026
→03Designing a Clean Data Boundary in Next.js08 Sept 2026
→04Why I Stopped Putting Database Queries in Components06 Sept 2026
→05Designing a Structured Portfolio Content Model05 Sept 2026
→06What I Actually Learned Building This Portfolio05 Sept 2026
→

OPEN
Thoughts on the article.
Finding the earliest divergence is probably the most useful debugging habit I have picked up recently.
Treating the error as evidence instead of immediately guessing at a fix completely changes the debugging process.