When I started working at Secret Escapes a common practice was doing pair programming. For me this was pretty new, I wasn’t used to pairing sessions of 30 mins or more. Previously I would pair for a couple minutes with a coworker to solve small bugs and use this in the same way as rubber duck debugging.
To begin with, I should say I pretty much sucked at this. During the sessions one of the two persons would hack the code until the issue was solved and the other person would stay idle and bored.
After some time of researching, I found an amazing checklist made by the people of thoughtbot. All of these things are just recommendations and I’d suggest you to try things out, test what it works for you (and your coworkers) and discard the rest.
Personally one of the things that worked the best when trying out this checklist was agreeing on the scope. This should be the same for both participants: either finishing a specific functionality, solving a bug or reaching certain point of an implementation. Otherwise, pairing for the sake of pairing would feel pretty much useless.
Another point that made pairing an experience much more enjoyable was doing time-based intervals and switching the driver / companion position. Setting timers of 3 to 5 minutes seems just about right for the pairing to be dynamic.
The experience should be pretty interactive all along, the companion should ask questions and communicate their observations, and the driver should explain their thought process and the why of the approach taken.
If you’re a Front-end developer, I would suggest using something like VSCode Live tool which works like a charm (sorry Vim 😓).
What did not work
On the other side, one of the things that didn’t work, was pairing for long periods of time. Pair programming on its own is quite exhausting and can drain a lot of energy. To me, the point before I’d start getting distracted (or exhausted) was about an hour - though this totally depends on you and the person you’re pairing with.
Something else that didn’t quite work was having one person doing all the coding. This leaves the other person in an idle state and is not an enjoyable experience for either participant. In the end, neither of you will learn or improve much.
I encourage you to try pair programming for half an hour or so, whenever you find the opportunity. It could be some issue that you cannot crack or a feature that you might not be too certain about how to implement.