We made sure to take breaks every 45 min-1h30 (depending how well the session was going), those breaks could be from 10 minutes to an hour, it needed to make us feel refreshed, not talk to people if needed, etc.
I actually miss this setup a lot, it was much easier to not feel stuck, much better to have a peer available all the time to bounce ideas, clear assumptions, discover the codebase, etc., but I couldn't ever do it 8 hours/day.
> We were very aware it wasn't possible to keep up like that 8h/day every single day. Most days we were very happy with 4 hours, really productive (and exhausting) days were around the 6 hours mark.
Some key points are that helped me:
1. You have to get on well with the person/people you're pairing with. You're working very closely with them, after all.
2. You have to take regular breaks. Pairing is mentally exhausting. But its not like 2 hours of conversations, we often sat there one person driving and being silent, the other person watching and making suggestions or pointing out issues. Usually when we needed to have actual discussions we would step away from the computer to do so. We also worked remotely a lot (I miss screenhero...) which probably also helped.
3. We never did overtime. We worked what the contract said and then no more work whatsoever. You need your downtime to recharge. We also usually went outside for lunch, to get a change of scenery and some air to clear our heads. (When we were in the office, when working from home, I dunno what the other guy did)
4. Sometimes you need some alone time to think, separate from a break. That's ok, take the time. Just make sure you both stop coding during this time. If the other person doesn't need time to think, they can go for a coffee or jot down the next tasks to tackle while coding. Or go for a walk.
5. When one person is out (sick, holidays, whatever) obviously the other person can't just sit around doing nothing. But when the other person is back, spend a day just doing code review with them so they can see what you did and why.
6. You need buy-in from all involved. In my case, it was a team of just me and another guy on that project. We were the ones who decided to try it, nobody told us to do it and we weren't forced to.
When one is loosing focus, there isn't a hesitation to say let's take a break. I found it similar to taking a timeout in basketball.
As an engineering manager I stressed it to the team. Take breaks or you will break.
Life is waaaaayyy to short for that shit. Work so hard you are in danger of injuring yourself. No thanks.
Which can be solved by taking breaks.
It is tiring. Some people don't like it. Evidently, it burns some people out (i paired for about eight years and didn't burn out). But some people get on okay with it. And when it's done well, it really is extremely effective.