Live data from Hacker News

Programmer interrupted: The cost of interruption and context switching (2022)

contextkeeper.io

71–80 of 271 posts

Re: Programmer interrupted: The cost of interruption and context switching (2022)

#71

My code editing style definitely has changed since the 90s when one-file-at-a-time without Intellisense was the norm. Jumping to compile errors was about the only automated thing. Now I just expect my IDEs, be it VS, VSCode, Eclipse to do a lot of heavy lifting for me. I wonder, though, whether I was more disciplined and kept a lot more context in my head back in those days. I'm also a lot older so I really don't wan…

The code was simpler.

Now java developers can't possibly write an hello world in less than 60 classes and interfaces. Without an ide to keep track of the com.path.that.i.made.up.for.my.package.because.it.has.to.be.at.least.three.pages.long they'd never be able to code like that.

Re: Programmer interrupted: The cost of interruption and context switching (2022)

#72
post #36

Non programmers won't get it. I am trying to explain it to my wife (using the cartoon on the article) but she says I am always busy. Which is probably true, but somehow she manages to interrupt my thoughts right when I was holding the whole heap in one hand, reaching for the duct tape with the other and pushing the keyboard with the nose. Never when I just started vscode :)

Programmers is not the only profession that has a high cost of context switching. Scientists, lawyers, engineers, writers - pretty much anyone doing intellectual work would understand.

You forgot doctors and nurses.

Re: Programmer interrupted: The cost of interruption and context switching (2022)

#73

I don't disagree but... If you're having a huge issue with this, I suggest trying to find ways to hold less context at one time. Write stuff down & get it out of your head more often. Write down all of your ideas & break down your tasks into smaller tasks. Don't try & solve a giant problem all at once without writing down what you're going to do. You may also discover issues earlier. It doesn't get rid of the issue 1…

Do you write it down to read it? Or write it down just to write it down? I find myself doing the latter a lot lately- synthesizing rough ideas to a couple approaches or components and prob a little sketch. I feel a bit guilty that I toss them without reading but for me I think the value is it crystalizes my thinking by putting a pen to paper.

Re: Programmer interrupted: The cost of interruption and context switching (2022)

#74
post #9

If I know I am going to have my day broken into sub 1hr chunks thanks to meetings and such, I pretty much write off the day entirely. It takes time to get into the flow state, some studies cite over 20 minutes, and once you are in it you want to stay in it for like four hours. No emails to follow up with, no slack, no zooms, no one tapping your shoulder, no conversations about the weekend distracting you on the perip…

> you seldom have the opportunity to work like how you've been training to work for all your advanced schooling ever again.

Sure you do. The college day is broken up into many unrelated scheduled meetings, with high switching cost. Then you do the deep work after hours.

My post-graduation life is not so different. Maybe it suits my brain, but it's been OK. I like the work.

Re: Programmer interrupted: The cost of interruption and context switching (2022)

#75
post #9

If I know I am going to have my day broken into sub 1hr chunks thanks to meetings and such, I pretty much write off the day entirely. It takes time to get into the flow state, some studies cite over 20 minutes, and once you are in it you want to stay in it for like four hours. No emails to follow up with, no slack, no zooms, no one tapping your shoulder, no conversations about the weekend distracting you on the perip…

> you seldom have the opportunity to work like how you've been training to work for all your advanced schooling ever again. Sure you do. The college day is broken up into many unrelated scheduled meetings, with high switching cost. Then you do the deep work after hours. My post-graduation life is not so different. Maybe it suits my brain, but it's been OK. I like the work.

How viable this is probably depends on what you study, but I skipped most of the scheduled meetings (lectures) during college. At the most prestigious of the 3 universities I've attended (which seemed to have more respect for their students than the other 2) this was actually encouraged if you felt you had better ways to make use of your time.

Re: Programmer interrupted: The cost of interruption and context switching (2022)

#76

Earlier quoted context omitted.

> you seldom have the opportunity to work like how you've been training to work for all your advanced schooling ever again. Sure you do. The college day is broken up into many unrelated scheduled meetings, with high switching cost. Then you do the deep work after hours. My post-graduation life is not so different. Maybe it suits my brain, but it's been OK. I like the work.

How viable this is probably depends on what you study, but I skipped most of the scheduled meetings (lectures) during college. At the most prestigious of the 3 universities I've attended (which seemed to have more respect for their students than the other 2) this was actually encouraged if you felt you had better ways to make use of your time.

Skipping doesn't work if you are the professor ;)

Re: Programmer interrupted: The cost of interruption and context switching (2022)

#77

Earlier quoted context omitted.

Maybe, you can SSH to GNU Screen and attach where you were, perhaps from your phone to just read. You could do the same with rdesktop to something x11, but you'd need more than a 256MB VM for that. If you have this running 24x365 then you'd spend more energy/money.

To all above: but machines reboot, also, not? Even our coorp Linuxes now succumb to ugly IT update reboot cycles, Cloud VMs even more ephemeral, and lets not even start with dev containers... One can script tmux sessions to some degree, but still loosing a lot of state (editor open ther, shell history here..).

Rebooting my dev boxes for security updates or kernel upgrades once every few months/year isn't a big deal, and I generally know when it's going down. The laptop is an ssh terminal/browser/doc reader only!

Re: Programmer interrupted: The cost of interruption and context switching (2022)

#78
post #9

If I know I am going to have my day broken into sub 1hr chunks thanks to meetings and such, I pretty much write off the day entirely. It takes time to get into the flow state, some studies cite over 20 minutes, and once you are in it you want to stay in it for like four hours. No emails to follow up with, no slack, no zooms, no one tapping your shoulder, no conversations about the weekend distracting you on the perip…

I have the unfortunate privilege to work at a firm where the senior engineering leaders believe context switching is a requirement. They judge people on whether they can do it.

I find that this leads everyone to constantly do multiple concurrent tasks. After a long day I often have a headache from having to concentrate on both my coding task, an operations task, a meeting, and a new request at the same time.

Ultimately, as you would expect - productivity is awful. They then have lengthy discussions on how to improve productivity by every mechanism other than what’s known to work (faster builds, faster tests, increased focus time)

Re: Programmer interrupted: The cost of interruption and context switching (2022)

#79
Anyone interested in sharing what tactics they use to get back into flow?

For interruptions (meetings or discussion) while coding I'll write a sentence or two directly in the file I'm working in - not comments, actual text. I'll explain what I'm doing and what the next step is, then close the IDE. When I come back nothing compiles and I'm forced to delete the text I added, which gives me a chance to read it and refresh my brain of where I left off. It's been one of the best approaches I've adopted over the past few years.

Re: Programmer interrupted: The cost of interruption and context switching (2022)

#80
post #9

If I know I am going to have my day broken into sub 1hr chunks thanks to meetings and such, I pretty much write off the day entirely. It takes time to get into the flow state, some studies cite over 20 minutes, and once you are in it you want to stay in it for like four hours. No emails to follow up with, no slack, no zooms, no one tapping your shoulder, no conversations about the weekend distracting you on the perip…

I also do much better with long chunks of time, but it should be possible to make meaningful progress on most programming tasks in a true 1-hour block. It’s common for people to use the Pomodoro technique to great success with blocks of work half that size.

Often, the real problem is that people don’t actually have 1 hour of working time in between meetings. We sit at our desks and feel obligated to respond to e-mails and Slack messages. Our Slack responses turn into conversations that consume 5-20 minutes without a clear end. We need to spend 5-10 minutes reading backlog to catch up. We need to get a drink or use the restroom. That 1-hour chunk of free time on your calendar may only have 10-15 minutes of concentration time, which is the real problem.

I’ve had some success with blocking off calendar time to mark 1-2 hours of focus time. Having something on your calendar makes delayed responses in Slack socially acceptable.

Post reply on HN