Open Loops Cause You to Be a Worse Programmer
Programming is difficult — it requires a lot of concentration. When we write code, we reason about it at different abstraction levels: we pay attention to the details of the lines directly in front of us while keeping in mind the bigger picture of the software.
The Zone #
Every programmer has experienced that feeling of complete concentration and focus. We call it the zone or the flow, and we try to get into that state as often as possible.
For me, it helps a lot to put on noise-canceling headphones and quiet my surroundings with music — albums like Random Access Memories or the TRON soundtrack work best. Of course, your mileage may vary.
Once we're in the zone, we've built up a detailed mental model of the part of the system we're working on. We know how it works. We see how the different components fit together. We understand.
Interruptions #
Unfortunately, that mental model is a fragile thing. Just like a house of cards, it collapses when we're interrupted — and it usually takes a long time to get back into the zone afterwards.
These interruptions don't have to be external, though; they can be internal, too. We can distract ourselves with unfinished thoughts that our attention keeps drifting back to.
Just like a computer processor, we incur a productivity penalty when switching between tasks, so we should try to get rid of these distractions.
Open Loops #
In Getting Things Done, a fantastic book about personal productivity and self-management strategies, David Allen calls those thoughts open loops:
Anything that does not belong where it is, the way it is, is an "open loop" pulling on your attention.
I think he's right. Unprocessed, unorganized thoughts consume brain power that could be put to better use, even if only subconsciously.
If it's on your mind, your mind isn't clear.
Our mind tries to hold on to these things, and that hurts our ability to focus on the programming task in front of us.
The Trusted System #
David Allen suggests building what he calls a trusted system to keep track of and free your mind from all these things:
Anything you consider unfinished in any way must be captured in a trusted system outside your mind, or what I call a collection bucket, that you know you'll come back to regularly and sort through.
The idea is that once you've gotten into the habit of putting all open loops into this system and reviewing them regularly, you can relax — you know you won't forget any of them.
After reading the book, I started writing down pretty much every actionable item that popped into my head, and I've learned to deeply appreciate this system. It helps me focus on one task and one task only. Despite a growing number of commitments and responsibilities, I can finally be an efficient programmer again.
