I understand, but why can't you stop fixing/refactoring/adding a feature for 5 minutes ?
Taking a break won't make you forget you everything, it mights make you more productive for the next 20 minutes.
For the record, I've worked on 20 years old code where maintanability didn't seemed like a important part.
Breaks doesn't always make you slower, it might do the contrary. Of course, there is no magical solution and you have to find a balance.
From the parent post, and I quote:
"What kind of problem takes 20 minutes to wrap your head around? Can you give me a working example?"
I'm not against breaks, the issue here is that someone mentioned that 20 minutes is more than enough to wrap your head around anything. I gave an example where most (mortals) would require substantially more than 20 minutes. Are we talking about breaks? Or the fact that some geniuses are able to figure out everything under 20 minutes?
Parent poster here — just FYI, I certainly did not say that "20 minutes is more than enough to wrap your head around anything". Was only looking for examples to assuage my curiosity.
I stand corrected. However it is a weird question to me and this mislead me into wondering how could someone not ever encounter any problem or task which takes more than 20 minutes to grok. Out of curiosity, what is it you do professionally? Do you get bored of it?
What I meant was, there's often talk on HN about how distractions during programming will tear down your "mind palace" and force you to build up your mental model from scratch. There are certainly problems I've dealt with that take more than 20 minutes (or even days) to grok, but almost none where I couldn't talk to someone and then jump right back in unless I'm actively learning/researching/debugging (which is maybe 10% of the time). With most of my work, I only have to deal with local functions and behaviors without having to run the whole stack in my head. Everything else is on paper or in my notes. But it seems that many others don't operate this way, and I'm very curious about this division.
Everybody is different. Personally, I can't keep multiple things in my head at the same time very well. I need to focus 100% (or as near to 100% as possible) on the task at hand. If I'm focused on solving a problem and somebody comes up to my desk to ask a question=, it's very similar to that xkcd comic where the mental bubble goes 'poof' and I'm back to square one.