During my day to day job at my company, it happens so, that I sometimes have to abandon task I’m currently doing, to take another one – perhaps a more important bug has popped up, perhaps there is some meeting. When coding, switching context comes at a cost. The cost depends on how I am to finishing the task, or at least it feels so for me, when dealing with defects. I will explain a little.
The impact of switching between tasks
While dealing with one bug, I keep track of quite some things: which files are important, which variables to monitor, which hypothetical solutions didn’t work. The more time I’ve spent on a particular bug, the deeper I went in the code, the more costly an interruption is for me. I have to leave all that context, stash or commit my current work (switching branches can be a pain if the project is bulky) and then start working on the more important thing. Most of the time, I feel a little anxious about switching to the other thing, as my preferred and more effective way is to complete things in one “run”, so to say. Stopping work, taking care of the new task and returning to it back later, takes more time to complete, than finishing the original task first and then taking care of the second one. The exceptions are small or easy tasks which take less than 30 minutes to complete, as they do not seem to distract me so much.
There are other interruptions in the office, too. Face to face communication sure is efficient, but it also takes much of a person’s attention. Because of that, if the issue I have to communicate is not very important or urgent, I tend to use Skype, or email, the latter being less intrusive to both parties, as it is considered a truly asynchronous communication.
There is also an issue of noise in the office, as it also may be distracting (I have a hard time ignoring my surrounding). I have an ambivalent attitude regarding listening to music though, as it somewhat helps me ignore the surroundings, but on the other hand, it can be disrupt my thinking too.
It seems like context switching can’t be eliminated in 100%. With correct management and properly set rules of communication between team members (to reduce the amount of interruptions to minimum) the switching will only happen in rare cases, so the programmers will be more productive.