[HN Gopher] Programmer interrupted: The cost of interruption and... ___________________________________________________________________ Programmer interrupted: The cost of interruption and context switching (2022) Author : jeron Score : 125 points Date : 2023-04-05 19:37 UTC (3 hours ago) (HTM) web link (contextkeeper.io) (TXT) w3m dump (contextkeeper.io) | BrandoElFollito wrote: | 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 :) | Eugr wrote: | 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. | danginmytoliet wrote: | All that I've gathered from articles and comics like this is that | we should quickly replace programmers with AI since programmers | easily become unproductive and thus more expensive because they | are easily 'damaged' by external causes. From a risk management | perspective, why would I hire a programmer and pay them 200k a | year when they cannot handle basic communication without becoming | unproductive? It sounds like I'd be better off with a robot if it | is capable of doing the same thing a human can, right? | Programming is the transformation of human language to a foreign | language that computers can understand. Are humans still | necessary when robots are able to understand humans and become | fluent ESLs? | shinycode wrote: | You won't use AI to replace a programmer because you likely | wouldn't have any job left to do, meaning either your boss will | replace you with AI or AI will replace your company altogether | 908B64B197 wrote: | > From a risk management perspective, why would I hire a | programmer and pay them 200k a year when they cannot handle | basic communication without becoming unproductive? | | Do you actually hire programmers (people just transforming | detailed spec into code) at 200K/y? Or do you hire Engineers | for 200K + Stock to transform uncertain requirements and | constraints into a working solution? If the former, you are | overpaying a lot. | | > Are humans still necessary when robots are able to understand | humans and become fluent ESLs? | | Does such a robot exists? | commandlinefan wrote: | > Does such a robot exists | | No, but if it ever does, they're going to replace all | programmers with it, regardless of their "soft skills". | cracrecry wrote: | >why would I hire a programmer and pay them 200k a year when | they cannot handle basic communication without becoming | unproductive? | | As entrepreneur myself, the main reason I pay someone 200K is | because I can make this person generate more than 200k in | profit. | | The fact that someone have flaws, like any human being has, is | an opportunity for me as I can make those flaws irrelevant by | providing the environment where a team could be extra | productive. | | That means the team needs me and my company. If they were | perfect on their own, they would not need me or my company at | all and would be able to compete with my company. | | If robots could one day do the work of programmers, they would | be able to do the work of managers and entrepreneurs as well, | which is way easier(I am engineer too). | | >Are humans still necessary when robots are able to understand | humans and become fluent ESLs? | | Yes, they are. | properparity wrote: | If an AI is ever capable of replacing a human programmer it | would also be capable of replacing a manager and running its | own company. | | So why would you even be in a position to hire anyone? | | In fact why are you working at all? The robots are doing | everything already. Just sit back and relax, enjoy the matrix. | marcosdumay wrote: | > we should quickly replace programmers with AI | | Well, nobody is stopping you. Go try. | intelVISA wrote: | Depends, can this fabled all-knowing robot also humor facetious | comments on HN? | klodolph wrote: | That's the same misconception about programming that people had | decades ago. People thought the same thing when we introduced | 5GLs back in the 1980s, and there was a lot of hype, and | programming became more accessible, but demand for programmers | increased rather than decreasing. People thought the same thing | back when Fortran was introduced in the 1950s, and programming | became more accessible, but the demand for programmers | increased rather than decreasing. | | The trick is that you need to hire someone to come up with a | description of the problem which is precise enough that a | computer can handle the rest. That person is the programmer. | | If you're being sarcastic, it's not clear, just put a /s on the | end or something. | Mountain_Skies wrote: | Same with SQL, which was promised as a way for data | processing managers to get rid of expensive programmers as | the managers would now be able to get whatever information | they wanted from their databases using an easy to understand, | English like language. All it did was change the nature of | the job of retrieving and storing database information but | didn't actually get rid of the programmers. | commandlinefan wrote: | > All it did was change the nature of the job | | It also created SQL injection vulnerabilities, so there's | that. | rqtwteye wrote: | AI will happen anyways. | SketchySeaBeast wrote: | Would you fire a brain surgeon if he's not willing to stop and | provide a consult while he's operating? There's even robots who | are equally as capable of surgery as AI are of software | development. | asdff wrote: | 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 periphery, just you and your task | at hand. | | It's pretty ironic, because this is how a lot of people study in | the library at college,show up and stay all night grinding in the | flow state with your phone shut off. Yet when you graduate to the | work place, you seldom have the opportunity to work like how | you've been training to work for all your advanced schooling ever | again. | | With respect to the article and maintaining context while coding | for different projects, I find having a tmux session for each | individual project super helpful. | MH15 wrote: | Having tmux sessions for each open task is a life-saver, | especially in an environment where I do all my work on a remote | server. Now I can close the laptop lid and never lose work. | Simply reopen the ssh connection and keep going. | asdff wrote: | Its especially helpful for stuff where I haven't touched it | in a while too. One alias and boom, I'm back in a session | with a pane with my editor open, a pane with the log, a pane | with some notes, and a pane with the shell displaying the | last line of code I ran from when I was last working on this | pet project over six months ago. Right where I left | everything and I can jump back in as if I was working on it | an hour ago. | darkteflon wrote: | I have a separate VS Code window connected to a dev | container for each project that stays open for days, weeks | or months at a time. Does the tmux approach materially | improve upon that setup? Genuinely curious if I'm missing | out on something here. | asdff wrote: | You can end up pretty deep down the rabbit hole with tmux | and configuring it in different ways. One thing you can | do that you might not be able to do with your vscode set | up is have a script, written in tmux commands, that | generates a complicated windowing environment. I am not | familiar with the capabilities of your setup though, | since I don't use vscode. I would guess tmux is more | comfortable than vscode for using it with just the | keyboard too. | | There's a ton written on tmux as you can imagine by this | point. This page seems pretty comprehensive on the | advanced features including tmux scripting: | | https://github.com/tmux/tmux/wiki/Advanced-Use | thepostman0 wrote: | 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. | throwbadubadu wrote: | 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..). | osdoorp wrote: | http://www.paulgraham.com/makersschedule.html | zcbenz wrote: | Since several years ago I was starting to have health issues that | if I sat still for too long my eyes/arms/legs/waist would feel | pain, sometimes fiercely. So I set a timer to remind me to stop | staring at the monitor and stand up to do some light exercise, at | first the timer was 40 minutes and in recent years it became 20 | minutes as my body wears. | | So now my work is interrupted every 20 minutes, at first the | timer was annoying but after several months I got used to it | completely and I don't think it affects my productivity. And | actually I wish I could do it from the begining so I wouldn't | have the health issues at all. | | However my interruption is short and during it I was uaually just | thinking about my work while stretching my body, so it is no | compare to hard context switches like being dragged to a | conversation. | ssgodderidge wrote: | Sorry to hear about the need to take breaks; that sucks. Glad | you're able to work around it, though. | | I suspect the physical exercise is key to your effectiveness | there. There's a big difference between a pause for a stretch | and a pause for a message about an entirely different | workstream. | | Not all interruptions are created equal. | dpkirchner wrote: | ContextKeeper sounds interesting. Can anyone here recommend a | similar extension for VSCode? Ideally would offer a way to stash | and unstash code and tab metadata (cursor position, undo state, | etc) with one IDE keystroke. | jrockway wrote: | This sounds very similar to Emacs's desktop-mode. | zwieback wrote: | 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 want to go back to the old days. | postalrat wrote: | Context switching is a skill you can and will improve as you get | interrupted throughout your career. | sethammons wrote: | that is one of the arguments in favor of the pomodoro | productivity technique. For the unaware, pomodoro says to set a | timer and do 25min of non-distracted work. Come up for air | (mandatory stop) for 5 minutes. Rinse and repeat a few times. | Some studies claim it takes 20min to get into the zone, but | pomodoro insists on breaking that flow about 5 minutes later. | The end result is training yourself to pick back up where you | were at. I don't do pomodoro any longer but it was reasonably | effective back when I tried it years ago. | ipaddr wrote: | This works.. | m3kw9 wrote: | XCode tip: if you open a new tab, your current tab is copied to | the new tab. It allows you to branch off from your current tab if | you don't want to mess it up. | m3kw9 wrote: | You can also rename an entire tab, but it's hidden in the | menus. Just search for rename from the help menu drop down | rqtwteye wrote: | We definitely need a mandatory all-team meeting about this every | Tuesday and Thursday at 2 pm until the issue has been resolved. | bitwize wrote: | At one worksite I did raise the issue of there being too many | meetings. The response was "Can we call a huddle sometime this | week to discuss this issue?" | lcnPylGDnU4H9OF wrote: | "The meetings will continue until morale improves." | ChrisMarshallNY wrote: | Sadly, the cost of context switching is well-known, and has been | proven, over and over again, for decades. | | But managers don't care (and many co-workers also). | | A quick shufti at most modern open-plan offices, shows the | contempt that managers have for developer context. They know | better, and have made the conscious decision to go open, anyway. | | I remember visiting the Facebook/Instagram building, in NYC, and | was aghast at the huge, noisy, crowded office. I would _not_ be | able to get any work done, in that environment. | | I'm grateful to be in a position, where I work alone (mostly), as | I can keep all those balls in the air, and the difference in | productivity is _amazing_. | mrighele wrote: | > But managers don't care (and many co-workers also). | | For the majority, the cost is not that well known and in | general they are not the ones paying for it, you are. | | In particular for your colleagues it may be beneficial to | disturb you because when they disturb you, you may lose | concentration but the may in fact avoid losing it by quickly | get an answer to their pending problem. | | This is one aspect where LLMs may be very useful: asking | something to a tool like ChatGPT may not be faster than asking | a colleague, but if it avoids ruining the colleague's | concentration it will be a net positive for the company. This | is even more true if/when those model will incorporate specific | internal knowledge (code, documentation) of the company. | whoisburbansky wrote: | Huh, I really thought `shufti` was a typo in this context, and | one that sounded funny to my Middle Eastern ears, so I was | surprised to discover it's a real word, albeit with Middle | Eastern origins [1]. | | 1. https://en.wiktionary.org/wiki/shufti | dangwhy wrote: | >But managers don't care (and many co-workers also). | | i bet 99% of time people are interrupting themselves. Like i | just did to browse HN. | gleenn wrote: | People definitely need some distractions but for me it's | definitely not 99% of the time. Also, I could argue sometimes | the solitaire game between coding stints is actually loading | up your brain with some software thoughts, and then giving it | a little break to process. Sometimes it takes a day for me to | come back and feel like my brain has reconciled some details | of a hard problem and only then can I make progress. | Eddy_Viscosity2 wrote: | A momentary distraction like a quick HN check is not the same | as the context switching of, for example, going to a budget | meeting while in the middle of trying to figure out some | technical detail. Very different things. | Turing_Machine wrote: | Agree completely. A self-determined break is an entirely | different thing from being interrupted by other people. | nequo wrote: | > i bet 99% of time people are interrupting themselves. Like | i just did to browse HN. | | I don't know about you but I am here on a pomodoro break | between two tasks. | lordnacho wrote: | For me it's not really to do with how much stuff is on the | screen. It's more that when you're doing creative work, the | intermediate state is a bunch of maybe-graphs. Maybe the bug is | a->b->c, maybe the bug is caused by d + e -> c, etc. Once you | find it, you know what it is and you can discard the explanations | that are wrong. But before that, you have a bunch of hypotheses. | Plus your mind knows that you intend to forget the details. | | When you're interrupted, you forget a bunch of the maybes and you | have to rebuild them. This is because your evidence is not strong | enough yet to have a small graph, it needs to be a big graph (or | set). | | Main advice is to take small steps. Little pieces that are easily | recoverable. Things like unit tests help to establish the facts, | allowing you to push some things out of your own memory. Also | take some notes to jig your memory. | | Sometimes you can't take small steps, because it just happens | that you didn't consider something and now there's a large | surface to think about. For those times, make sure you're not | interrupted. | omnicognate wrote: | I actively like being distracted when I'm programming. I tend to | approach a problem from lots of different directions, each time | fizzling out, hitting a block or having some sort of mental | reset, until something unconsciously clicks and an overall | structure, understanding or solution emerges. Continually leaving | and returning to the problem is a part of that process, so I tend | to find someone walking up with a question rather welcome. The | biggest and most effective leave-and-return is of course to sleep | on it, and it's rare that I go to bed with a problem at the back | of my mind and don't wake up with at least a new approach or | insight. | | I have to be careful, though, as I'm aware most of my colleagues | don't feel the same way about interruptions. | inciampati wrote: | Indeed, this seems unusual in programmer land. As evidence we | have a thread like the current one reaching the front page | several times a day. | | But your way is also my way. I am active in a very wide array | of topics, and happy to flit between them. Sometimes I dive | deep, but it's usually in a critical moment of synthesis when | ideas developed over months or years come to clarity and I put | them to action. This is working extremely well for me. I lack | nothing and am at the absolute cutting edge in every topic I'm | pursuing. Of course this is my opinion but it's sufficient to | say that I'm happy. | | It is sad to see how many people are made uncomfortable by | interruption. It's the stuff of life, social life at least, and | exactly what makes being human in a dense society so wonderful. | I feel it represents a fundamental discomfort with being in | situations out of one's control. But, that's the core of life. | And for me it's where all the creative energy comes from. | | edit: Reflecting on John Carmack and his big monitor. I | habitually work in single window terminals with relatively low | row counts and big fonts. I seem to be unable to get a benefit | from seeing more stuff all at once. | | edit2: And in terms of getting into flow state, for me it is | always basically instantaneous. The flow is just sitting there | under a few seconds of pause. Of course sitting at a computer | or phone will cause wandering distraction at times, but if work | is in play I can start driving at full speed in what would | typically be seen as a horrifically uncomfortable position. | Imagine a long distance train with two children jumping on | you... If I can see my laptop and the kids at the same time, | I'm flowing. I think this might be neurological somehow, due to | training or genetics. It's unclear. | tester457 wrote: | > It is sad to see how many people are made uncomfortable by | interruption. It's the stuff of life, social life at least | | A key concept from the book "A Mind for Numbers" is the | difference between "focus mode" and "diffuse mode" thinking. | | Focus mode is essentially a concentrated flow state and | diffuse mode is a relaxed state, open to distraction and | creativity. | | Both modes are necessary for effective problem solving but my | issue is an abundance of distractions which keep most of us | stuck in the diffuse state and no time in the focused state. | | > And in terms of getting into flow state, for me it is | always basically instantaneous. The flow is just sitting | there under a few seconds of pause. | | Rare, for most people it takes 20 minutes. If I get equally | spaced out distracting emails I will spend no time in the | flow state at all. | kosasbest wrote: | It's the shadow work of programming I never liked. | | - Setting up boilerplate code | | - Configuring my IDE | | - Configuring special browsers (for web development) with no | addons or tweaks done so it appears like an average person is | using the browser | | - Configuring the OS | | - Separating work from play. Keeping separate machines strictly | for programming | | - Tests | | - Reading best practice material | | - Researching if other people have written the exact same thing | as you and uploaded it to GitHub (or don't repeat what other's | have coded already). | | All that can be set-and-forget but I periodically have to do it | all again because requirements change, or I get a new machine or | I simply want to re-configure my development environment for | minor (or major) gains in productivity. | dariusj18 wrote: | And what's worse than all of that, is if a company tries to do | it for you. | frereubu wrote: | Now I have a family I often can't choose the end of my working | day so it coincides with a natural break in my work. In those | circumstances, when I know they're going to arrive back in less | than 30 minutes, I stop working and do a brain dump of everything | that's going on in my head into a plain text file. With that I | can pick things up much faster the next morning. I've even | started doing it during the day when both my wife and I are | working from home and we're about to have lunch together. I'd | seriously recommend it. | | It somewhat reminds me of this Hemingway quote "You read what you | have written and, as you always stop when you know what is going | to happen next, you go on from there. You write until you come to | a place where you still have your juice and know what will happen | next and you stop and try to live through until the next day when | you hit it again." I think there's an art to stopping at the | right time, even if it's within constraints that aren't in your | control. | dmcq2 wrote: | At a job I had they wanted me to install an instant messaging app | on my compute! I refused point blank. I said they could email me | and I'd look at he email every so often. If it was really | important they could get up and walk to see me. If it wasn't | important enough for others to walk then it definitely wasn't | important enough to interrupt me. Before that I was at a place | where they had tannoys. I moved the tannoys away from me but they | were still annoying. I tried showuing that they were losing the | place millions. It would have been far cheaper to have somebody | employed to walk around looking for people. They only got rid of | them when marketing got in and the first thing they said was to | et rid of the tannoy. | m3kw9 wrote: | I get big screens but multiple screens gives diminished returns | vs tab/spaces switching. Laying out the windows across different | screens is always a pain in the ass | mattferderer wrote: | 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 100% but it helps a lot. I say | this as a dev who has to do a lot of context switching. | Casteil wrote: | >If you're having a huge issue with this, I suggest trying to | find ways to hold less context at one time. | | For many who experience this regularly, that basically means | leaving/finding a new job. | | With many employers, it's very difficult to escape being spread | thin once you've proven your competence and they lean on you | hard as a result. | dagorenouf wrote: | I view coding as creative work not that different from writing or | drawing. Sure there are techniques and rules to follow, but to do | great work you need to get in the flow of things until your | creative brain figures stuff out on its own. It takes time to | warm up and any interruption destroys the momentum you had. I put | my phone on airplane mode for most of the work day because of | this. ___________________________________________________________________ (page generated 2023-04-05 23:00 UTC)