Any programmer will tell you that one of the characteristics of really getting into a programming "flow" is that your mind is completely engaged. I think of it sort of like a stack. I have all these small tasks which need to be accomplished, and which can’t be put off because they’ll block my progress.
So, I stick the current task on the top of the mental stack, and do the little diversion. The diversion might have more diversions which get stacked on top. But pretty much I do them in last-in-first-out order. For example, today I was programming an email confirmation system in Django.
- I was testing my form template, and wanted to make it both pretty and XHTML valid (Stack: 1).
- To do that, I needed to make a base template which the confirmation forms would extend (task 2).
- The base template really should use CSS for ease of formatting, and for standards compliance (Stack: 1,2).
- Oh, but CSS in Django really should be served by the media server, yet I haven’t mapped the media URL on my development server. I should do that now, or else it won’t resolve (Stack: 1,2,3).
- Start NetInfo Manager, map it (Stack 1,2,3,4-complete).
- Add the media url domain to Apache as a virtual host (Stack: 1,2,3,5-complete).
- Bounce apache, test media domain (Stack: 1,2,3,6)
- Troubleshoot why apache didn’t bounce properly - bad vhost line (Stack 1,2,3,6,7-complete)
- Bounce apache, test media domain, success (Stack: 1,2,3,6-complete)
- Test Django CSS from template, hard coding media URL (Stack: 1,2,3,8-complete)
- Oh, but hard-coding is foolish when the media URL is stored in the settings. Is there a way to use the settings? (Stack: 1,2,3,9)
- No, but I can write a templatetag. (Stack: 1,2,3,9,10)
- Lookup template tag docs, write one to do media URLs for me. (Stack: 1,2,3,9,10,11-complete)
- Test new template tag. (Stack: 1,2,3-complete,9-complete,10-complete)
- Test base template with new tag. (Stack: 1,2-complete)
- Test form, extending base template. (Stack: 1-complete)
A stacked task example
If you are a programmer, you’ll recognize this style of thinking. If not, and you’ve managed to read this far, perhaps you’ll understand a bit more why we get flustered when people walk up to ask questions. If a programmer is managing a stack of tasks 5 or 6 items deep, it gets easy to lose the thread of what is going on.
I’ve been working for years at getting better about interruptions. I love the flow state, but I think that we programmers make it too fragile when we try to keep everything in our head. The thing is that always seems like you are almost there, so the time to write down anything about your stacked task is a waste of time. I’ve been fighting that tendency, with varying degrees of success.
For quite a while, I’ve been doing this mostly by keeping an engineering notebook. That way I can scribble notes which will - sometimes - lead me back to the path if I get distracted. Today I tried a new technique, which was to use the excellent little app Sidenote for OSX. It is just a little "Sticky" style note taker which lives on the side of your screen. It minimizes when not in use, and it autosaves all the time. That’s a nice bit right there, you don’t even have to think about saving.
Basically, I’ve started using it for two things. 1) To track my "stack" and 2) to track needed/possible future refactorings. I haven’t gotten fully in the habit yet, but I had a six hour long coding-flow session today, and Sidenote was a very helpful part of that. The stack is empty and I have one refactor to do. Plus, I got to code my heart out, which always feels great.
Technorati Tags: Sidenote, flow, coding flow, productivity, programming
















3 responses so far ↓
1 Simon // Mar 4, 2006 at 11:35 pm
Hey Bruce,
I agree with your description - and the critical need for “sticky notes”. I also used to use a stack of “recycled” code printouts in the gap between keyboard and monitor to scribble notes on in a hurry.
The “flow” is super-critical in any creative activity - and coding is no exception. But the problem we often face in an office or business environment is how to handle interruptions. Often programmers are seen as rude because we are just “engaged”.
2 Marc // Mar 5, 2006 at 2:01 am
Yep, your description of the “stack” definitely rings true with me. I very much tend to operate much of the time in a LIFO or “latest is loudest” sort of mode. My solution, as you mentioned, is to resist the temptation to do the latest thing in my head right away and to write it down somewhere so that my mind can relax and know that it’s accounted for somewhere.
This is very much in line with David Allen’s “Getting Things Done” methodology (which I’m a fan of) and I think it’s the reason that coders seem to have particular interest in David Allen’s methods.
3 Bruce // Mar 5, 2006 at 8:26 am
Marc, that’s the key right there. The ability to mentally “relax”, sure that you won’t lose track, leads to a prolongation and enhancement of the flow state. The great thing was that I was able to take a lunch break, talk with my wife, and then go back to programming, immediately resuming my flow.
That’s rare, and I have to credit my new attention to technique.
Leave a Comment