The interruptible programmer
stevestreeting.com
stevestreeting.com
You see, the human mind can only hold so many concepts in active thought at the same time. It's somewhere around 7. If paying attention to your surroundings is 1, there's only 6 left. If someone -happens- in the surroundings, there's at least 1 more gone. If something -interesting- happens, there 2 or 3 more as you go off on tangents thinking about them.
Yeah, half your mind is taken with your surroundings at times.
My solution is to pay attention to my surroundings when working on easy projects, and for projects that -really- need my attention, I put in earphones and block everything out. I have a few different music sets that I've heard so many times and/or they have a sound that doesn't ask my brain to process them.
With my earphones in, people have to yell (or call my phone or IM) to get my attention. I don't check even check my email.
I usually don't have to resort to the earphones. One line of thinking is that if it takes all your ability to write the code, you couldn't possibly fix bugs in it. You should be writing well below your ability so that you can fix it when it breaks. This usually means the code is easier to read as well. But some things are just innately complex, and there's nothing you can do about it.
They're often perplexed if I'm late to a meeting or aren't up to date on the latest email. I generally keep Outlook closed which manages my calendar and email.
See Tufte: http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0...
"That essay reviews psychological experiments that discovered people had a hard time remembering more than about 7 unrelated pieces of really dull data all at once."
//file this under benefits of a liberal arts education...
“Dave Hoover:
“The chair has four legs... Now, an animal has a one track mind, For instance, the animal is coming after you with the idea of tearing your head off... You put the chair up, and all of a sudden, he has four points of interest. He loses his original train of thought because this agitates him. He can’t comprehend those four points of interest, so what he does he attacks the chair. He takes his wrath out on the chair. His mind now had been completely distracted from his original thought: ‘Eat the man in the white pants.’
“It’s basically animal psychology. You try to keep the animal afraid of you in that he does not understand you. He does not understand that you’re weaker than he is. [...]”
(The next few paragraphs are also quite interesting, and I recommend the film generally.)
Lions are surprisingly not vicious towards humans at all--since there's no species that can fuck with them they don't have the vicious fear response most animals have. That's the real trick to lion taming--and the reason you can tame a lion but not a jaguar. Tigers are the same way. The big danger with either of them is actually playfulness--they don't always realize how strong they are.
If you are unlucky enough to be interrupted while in that kind of state, the spinning plates effectively fall and break - it can almost be painful, and certainly drudging to get back up to where you were before. I've found this tends to take anywhere from 30 minutes to a day of time away from me because getting back in that flow state can be so damn difficult.
I think a lot of the problem comes down to us using the brain for stuff it's not great at.
I suppose the ultimate goal is too keep one's code clean and simple enough that one does have to go into super brain mode in order to solve a problem. Sadly we don't live in an ideal world.
I don't think what you claim as ideal is possible - the only thing a programming environment can hope to offer is to eliminate as much accidental complexity as possible, leaving you to focus on essential complexity. The real-world problems we try to solve as developers are usually at least somewhat hard (even the seemingly simple ones), no getting away from that.
In no way intending to be condescending, I seriously recommend you read 'No Silver Bullet' by Fred Brooks if you haven't already - http://en.wikipedia.org/wiki/No_Silver_Bullet - an absolute classic (and important too I think).
Let's drop back into reality for a minute. Just 15 minutes ago I was tracing sql data converted to xml by a rails application which was processed by a perl frontend. Yay legacy code.
It would really be nice for things to be simple but the reality is I'm dealing with multiple erp systems that output mostly similar xml thanks to the people that where here before me. It is not possible to not end up in super brain mode with some of the problems I deal with.
Now my latest project was rather complicated. I took a report that only showed current inventories and converted it to display inventories at any specific day. It was all fine and simple until I encountered a little off by one bug which caused most of the dates to be off by one. Tracing that error through all the layers required a number of hours. I am thankful I was not interrupted with an emergency fix to some production report so it only took hours to fix instead days.
It would be nice if things were simple but not everyone gets to work with clean environments and applications.
I'll argue that it is possible, just not necessarily preferable. You could rewrite the whole thing. You could also focus on building a number of small functions which brings the whole interface up to a human-digestible level.
The reality of the matter is not the realm of possibility, but instead that you often just want to get it working by whatever super-herculean effort it takes. People are often very interruptible while fighting hydras or stealing golden fleece.
So it's twofold. Ensure that as often as possible you've got the programmatic infrastructure to only consider human-digestible chunks of complexity at any given time and try not to be interrupted whenever that's not possible.
No, it's not possible. I do my best to minimize complexity but it's hard.
I don't have access to most of the systems I interface with. This is what I am talking about. The complexity is not just in legacy code but in interfaces I don't have control over. The project I mentioned was a complete rewrite and I'm able to modify most sections of it without tons of brain power. It's just the main report that's confusing as hell due to requirements.
When things external to code are complex you need brain power. You need to create abstractions and your abstractions end up being complex because you can't mask some of the requirements behind simpler code. There is also a problem of lacking tools. I have no ability to use a real debugger on any of the programs I work with. Only one application will run on my laptop, everything else is sitting in a carefully deployed minefield of interconnected dependencies on various linux servers.
I know of no solution not involving time travel to solve that for legacy reports and systems. Obviously going forward one can worry about documentation, etc. but with legacy stuff it is already too late to implement those rules.
Teamwork is a competitive advantage because a good team can develop more complex systems than a single programmer.
Clean and simple code with good architecture is a competitive advantage, because using simpler more appropriate constructs, we can develop more complex systems (or our systems run faster, or take less resources)
If we are able to go into super brain mode we are able to deal with and build more complex systems.
I like clean code as a competitive advantage, or force multiplier, but I also like the ability to use super brain mode to be able to handle more complex systems.
The double edged sword is that you've made a more complex system requiring the focus of super brain mode to work with, but if you use it carefully, sparingly, and wisely, perhaps your system can do things that a constant interruption brain mode system just can't do. It's a dangerous but powerful tool in my opinion.
Perhaps working in that space is what separates the good or amazing developers from the code monkeys? Or is it always too much of a liability to have such a system?
Let me ask this: after you've written such code, how is it for other people to read it? What is it like for people to debug it?
I think a lot of the problem comes down to us using the brain for stuff it's not great at.
I think good programming design tries to maximize the stuff your brain is good at and minimize the use of stuff your brain isn't good at.
Much of the problem with interruptions is that of losing context. When you’re in that Zone, you’re juggling a whole bunch of context in your head, adjusting it on the fly, and maintaining and tweaking connections between issues constantly.
I find that there's an all-too common hair-shirted developer mentality that glories in the stunt of keeping track of umpteen different entities and variables at once. Mental/conceptual organization is an area where work smarter should definitely trump work harder. I think a part of the problem has to do with the tendency for dramatic fire-fighting to be rewarded in organizations. What results is like an emergency responder TV show. It's exciting to watch the responders rappelling or doing something exciting and unusual every week, but in reality a well run city would strive to make such events as rare as possible and be boring as possible.
Think of it this way, if you ran a trucking company, would you want employees who had a different hair-raising tale to tell on just about every trip? Do you know developers who are full of such tales?
Then one day I thought about the 66 minutes I 'waste' each day on the train to university; 33 minutes per trip. I started to take out my laptop as soon as I get on the train and try to work on programming. Initially I had very little done, by the time I really start programming it was time to get off.
But now, 3 or 4 months into it, I seem to manage to get something done every time; I'd say now the 33 minutes is worth at least 20 minutes of productivity if I had been spending it in a 4 hour block.
When I was teaching English, for one class, I gave groups a human-slide puzzle activity. A group of 8 were given a number from 1-8 and arranged randomly on 9 numbered squares. They were to re-arrange themselves in order by moving one person at a time to the empty square.
The last group to complete it was having a really tough time and kept complaining to me that they couldn't do it. After all the other groups had finished I announced they had 5 minutes left. They completed it just before the time was up.
You have to figure in some time each day away from the screen but still thinking about work in a kind-of background task. And carry a notepad or make voice memos when the light bulb moment strikes.
This recent HN item is relevant: http://calnewport.com/blog/2007/10/08/monday-master-class-ho...
I have a terrible memory and this is what I have learned to do. Long coding sessions? No; I design, then plan out a short amount of coding at a time. Especially if I'm modifying unfamiliar code, I'll make notes about what functions I need to change and what changes need to be done and in what order, and the possible side effects that may result so I can test for them. Leaving for the day, I'll just write down what I was last doing and what's next on a post it note and that removes the excuse of staying at work "just a few more minutes until I finish up this method."
In the end I find it's far more productive than sitting down for hours coding away. And a nice side effect is that it really doesn't matter if I'm interrupted because where I am and what I was doing is already documented.
Doing this forces me to think at a higher level about overall data & control flow instead of being down in the weeds all the time where it's hard to see the big picture.
Surprisingly, the first part (just starting) is harder than following through.
YMMV, but I've found out that the 5 mins breaks do not destroy my "state", as long as I don't start anything that tends to suck in like playing games or browsing the Web. Fetching coffee, going to the toilet, etc. is OK :)
Anyway, the hardest thing is usually starting the first block.
Note: Unfortunately, the Dropbox integration is currently kinda borked, sometimes displaying the password in the clear, or with connection failures.
Extraverts of course face the opposite problem. How do you remain focused on the outer world world while not becoming completely dependent on your coworkers?
There's no suggestion that you're going to change your environment in unrealistic ways, it's more about dealing with the fact you don't work in a perfect space.
Ingenuity and Ticket Systems don't combine very well.
There's no list of action items for Truly Cool Stuff. You just dive in and start messing around. You can probably externalize some context as you cross off ideas and concepts that won't work. But there's no game plan, thus no concept of a "Next Action". You're on a blank sheet of paper with a head full of context, and any distraction will kill that.
So yeah, there are circumstances where you can survive interruptions. But there are also circumstances where they'll kill you.
But taking a couple weeks off from a project really sets me back. It could take can entire day to get back up to speed.
What ticketing system does he use that he can "get in and out of in 30 sec" ... so that he can toss every new idea into it without breaking his flow?
How, specifically, does he track his context? In particular, how does he track context across multiple projects while still being able to react to interruptions in a timely way?
How does he track his one-and-only-one next action for each project in a way that's simple/easy/fast enough that he doesn't give it up in disgust?