You've stared at the same function for an hour.
The bug isn't there.
If it were, you'd have found it.
The hard bugs live in your assumptions —
the input you were sure was clean,
the call you were sure happened,
the state you were sure got reset.
So stop rereading the suspect.
Start doubting the thing you trust.
Print the value you'd bet money on.
It's usually the one that's lying.
Debugging isn't about being smart.
It's about being willing to check
what you already "know."
– Serguey Asael Shinder
Top comments (0)