I don't believe it's possible to actually write code under those conditions. I certainly got nothing done in those three hours. I don't mind doing a code walk-through or review, or a design discussion, but you don't need to sit close enough for sex to do those.
To write code one needs to concentrate and focus. This is not open to discussion. And focus does not go with communication and conversation.
The one time I did it I was hideously uncomfortable, the other guy was one of those lickspittle corpflacks that Microsoft favors, the one who had written their coding standards document that didn't have a single worthwhile idea in 20 pages and which I had told my manager I could not follow if I was expected to produce, because I needed to be able to read my own work.
At one point he went to my whiteboard to explain polymorphism to me, something I had understood when he was breastfeeding.
The funny part was that they did this to me to get me to quit because their first layoffs ever were a fortnight away and they wanted to massage down the numbers. They didn't need to. I had met the guy who was to be my next manager and there was no way in hell I was working for that bastard.