I fixed the bug at 11pm.
I only know that because I checked the git log the next morning. The commit that made everything pass was at 23:04.
I kept debugging until 2am anyway.
So what was I doing for those three hours?
Honestly... mostly rerunning the same tests.
Reading the same 40 lines of code.
Changing something.
Changing it back.
Refreshing a page that had already worked like six times.
And somehow still thinking:
“maybe this time.”
I don't think I'm the only one who does this :(
The loop
It usually goes something like this:
- Something breaks
- You try the obvious fix
- It doesn't work
- You try basically the same fix again
Step 4 is the dangerous one lol.
Not really a new idea. Just the same thing with one tiny change that you probably couldn't even explain if someone asked why you changed it.
Then it fails.
So you change another tiny thing.
Run it again.
Still fails.
Again.
I think sunk cost is a big part of it.
Once you've already spent three hours on something, stopping feels like admitting those three hours were wasted.
Continuing feels like maybe you can still “save” them.
Which obviously makes no sense because the three hours are gone either way.
But try telling yourself that at 1am when you're 100% sure the fix is right there.
There's also this weird thing with debugging where sometimes repeating something actually does work.
Maybe a cache expired.
Maybe a deploy finally finished.
Maybe some service restarted.
So once in a while, retry number 4 magically works.
And I think that trains your brain in the worst possible way.
Like a slot machine, basically.
Most attempts give you nothing, but every now and then you get rewarded, so your brain goes:
“SEE?? ONE MORE TRY.”
The other problem is that these two situations feel exactly the same when you're stuck:
This will work if I keep going.
This is never going to work like this and I need another approach.
From the inside, I genuinely can't tell the difference sometimes.
Same frustration.
Same tunnel vision.
Same feeling that the answer is probably one stupid line away.
The thing that actually helps me
It's not discipline.
I've tried the whole “be disciplined and stop after ... minutes” thing.
Works great for about a week :D
The thing that helps the most is when someone else has already hit the exact same problem.
My friend saying:
“oh yeah, that's the schema cache. restart it.”
And suddenly three hours of suffering disappears in one sentence.
It's not even that they're smarter than you.
They just already paid the price to learn that weird little piece of information.
You didn't have to pay for it again.
That's honestly why I think Stack Overflow was such an important thing for developers.
Not only because it had answers.
But because you could search some weird error message at 1am and find proof that another human being had already experienced the exact same pain.
Sometimes that's enough to get you unstuck.
What I've changed
Nothing revolutionary.
Two very small things.
A 25 minute timer.
If I've been on the same bug for 25 minutes, I stop and write down what I've actually ruled out.
And this is embarrassingly effective because sometimes I start writing and realise:
“I haven't ruled out anything. I've just been running the same test for 25 minutes.”
It's hard to write that sentence and then immediately run the test again lol.
The second thing is just explaining the problem out loud.
Sometimes to another person.
Sometimes to myself.
Sometimes to absolutely nobody.
I'm not even asking for help.
I just explain what I think is happening.
And halfway through the explanation I'll say something like:
“so this function should receive X because—”
...
oh.
There it is.
Rubber duck debugging is stupidly real and I still don't fully understand why.
None of this completely fixes the problem btw.
I still had a 2am debugging session last month.
But I think the difference now is that the gap between:
“I'm stuck”
and
“oh... I'm doing the thing again”
has gotten smaller.
And honestly, I think that gap is where most of the wasted hours go.
I'm actually curious about this.
I mean on the genuinely bad nights when you've been staring at the same function for two hours and your brain has completely stopped working.
What do you actually do?
I have a feeling the embarrassing answers are probably way more useful than the productivity advice we've all already read :D
Top comments (0)