You fix the first problem and a second appears. You fix that and the first returns in a different form. Two hours later there are more problems than when you started and the code has grown considerably.
What does this actually mean?
That the diagnosis is wrong. Fixes addressing a symptom rather than a cause move the problem rather than removing it, and each move produces a new symptom in a different place.
Continuing to describe the latest symptom produces another move.
What is the first thing to do?
Revert everything and go back to the original problem. The accumulated changes are now part of the difficulty, and unpicking them individually takes longer than discarding them.
This requires having committed before starting, which is the argument for doing so.
Why does the conversation itself become a problem?
Because the failed attempts are in it. A session containing four unsuccessful fixes influences everything produced afterwards, and the fifth attempt is drafted in the shadow of the previous four.
A fresh session with the original problem and a note of what has been ruled out produces noticeably better results.
What is the reframing that works?
I have tried these four things and each fixed one symptom and caused another. That suggests I have the cause wrong. Given the original behaviour and all four of these results, what single underlying cause would explain all of them?
Supplying the failed attempts as evidence rather than as history is what makes this productive, since a cause that explains four symptoms is considerably more constrained than one explaining one.
What are the usual underlying causes?
- Shared state. Something modified in one place and used in another.
- A wrong assumption about the data. Which surfaces differently in each place.
- An ordering problem. Where things happen in an unexpected sequence.
- Two bugs. Which people treat as one and never resolve.
How do you tell whether it is two bugs?
By whether the symptoms have anything in common. Two unrelated problems interleaving looks exactly like one intractable problem, and separating them makes both tractable immediately.
What should you do about scope?
Fix one thing at a time and verify between each. Batched changes make it impossible to attribute a new failure, which is how a manageable situation becomes a circular one.
When should you stop for the day?
After the third circular attempt. Judgement degrades noticeably during this kind of session, and people who return in the morning frequently find the cause within ten minutes, which is not a coincidence.
What should you do before starting again?
Write down the original symptom, exactly as it appeared. After two hours of changes, people frequently cannot state what the initial problem was, and the investigation has drifted onto something the fixes introduced.
That note also tells you whether you are finished. A session that ends with the second problem resolved and the first still present is a common and unnoticed outcome, since the original symptom stopped being what anybody was looking at somewhere around the third attempt.
What is the rule?
Three failed fixes means the diagnosis is wrong. Stop fixing, revert, and go back to establishing what is actually happening, because no amount of better fixes solves a mistaken understanding of the problem.