$\begingroup$

As a computer programmer, I have noticed an interesting phenomenon: If I am stuck on a particular problem in my work, often if I stop thinking about the problem and do something else, the answer will suddenly come to me.

Is there a name for this phenomenon? How does this work? Has any research been done on this? How is it that taking a break from a problem sometimes allows you to figure out the answer?

Edit: I remember now where I heard about this phenomenon: on the Charlie Rose Brain Series, Eric Kandel of Colombia University says (at 43:20 in)

[The unconscious] can do many processes at the same time. You can either focus on one thing or another, you can't focus on two or three things at the same time. Because consciousness is very limited in what it can do; unconsciousness is much broader. And although we know very little about the true nature of creativity, one emerging theme that comes out of this is that, if you're trying to solve a mathematical problem... if you're trying to solve any intellectual problem... you keep on focusing at it, you may get stuck. Taking a break, taking a shower, going for a walk, playing golf, you come back refreshed. And often doing the other activity, boom, the idea will come to you.

But then they change the subject! What is the concept he's talking about, and where can I read more about how it works?