I don't even know if this question makes sense ... but let me let you grok it...imagine ...You're totally absorbed into some programming thought/idea/concept,  your brain is in it's most active state thinking up a solution to a  problem, or as Joel  Spolsky  puts it -- you're deep into your zone -- AND, suddenly someone or  some event breaks your engrossment -- something that you just can't  avoid, something you have to attend to. ... imagination complete .. back to realitySomething that can break your concentration can be...you're summoned for an urgent meetingyour code broke the daily build and your colleague is calling youyou just recalled something you had to do but forgot doing ityour teammate has some exciting news to break and insists you to listenyour girlfriend (or boyfriend) has just come overNow assume you've got only 5-10 minutes before you have to leave what you were deeply into, and entertain the interruption.My question is -- how do you, quickly save the state of mind you were in, when the diversion came. Do you write it in some form on a paper or computer, or do you just remember it somehow. How do you salvage those exact thoughts within 5-10 minutes so that later on when you come back you can catch up right from the point you left.It often so happens to me that i just can't recollect those exact thoughts i was thinking before the blow -- and i feel like i've lost a good idea or solutions to a problem. i try to think retroactively trying hard to get to that SAME cognitive state that had me excited about an idea -- but i get frustrated not being able to get there.does something like this happen to you. how do you recover from this?-- UPDATE --My main concern is not code -- it's those abstract ideas that haven't been yet converted into code that i need to save somehow
best way to quickly stash your cognitive state when you just can't avoid interruptions
productivity
Before leaving my PC I'll write what I was doing down on a post-it or on a piece of paper. I'm usually doing this anyway as a part of a bug fix or analysis. It's really helpful when a bug is (re)opened later, you can still see your lines of thought of a month ago and find out what you have to do a lot faster.Also: set some bookmarks in your code. When you come back you can look at what you were doing by viewing the bookmarks you set.