I spend quite a bit of time coding in front of my computer (especially when handling tricky bug hunting…) but there’s two places where I do much of progress:
I might sit down a sofa and make notes on paper. I might build pseudo code in order to solve certain coding dilemmas. I might lie down and just stare the roof and think. This is all without a computer. Pen & paper you know.
The other place where my code is refined (without even thinking it) is in my bed, while at sleep. I might have some tricky coding puzzle that won’t solve by staring the screen. After failing to see the solution, I might realize that now I just need to stop, go to bed, and see the solution the next morning. And this has yet to fail me.
Sure, I can do “puzzle solving” in front of my computer, but I’ve found it good to prepare and plan the code in my mind while somewhere else. That’s where the hard part happens. That’s where the thinking process takes place.
After the plan is made, it’s easy to sit and start typing the code together.