There are many benefits to pair programming such as writing challenging code more quickly, writing better code than you would write on your own and learning.
I am often asked how much should people be pair programming?
It’s important, when your team is pair programming, to understand the limits so that you can build in some daily breathing room.
People Should Pair Program for about 6 Hours a Day
One of the main outcomes of pair programming is that you and your pair will end up relentlessly focusing on the problem in front of you. Doing this even for 6 hours a day yields quite a lot of code but can be exhausting. I’ve talked to enough people and had to, myself, pair program for 8 hours enough to know that it turns pair programming into a weary slog on the road to burn-out.
What happens to the other 2 hours? It could be spent in any number of ways: it could be a way to let parents go home early, it could be time a new person spends learning something that you might need tomorrow or, it could simply be some time for catching up on emails.
Take a break from each other at lunch
Pair programming is great but is skewed towards extroverts. Introverts who are pair programming will need to recharge their batteries at lunch by doing their own thing and getting some quiet time. In fact, a healthy office will have spaces where quiet time can be spent.
In the U.S. and other countries, there is often social pressure to be part of a group, especially for mealtimes such as lunch. If you work at a place that emphasizes pair programming, however, it is worth taking note that you might see people at lunch who are taking a few solo minutes before they go back to pairing for the day.
Separate for a bit to do research or find an answer
Even if you are paired up with someone for a day. You might hit a spot where you either need to learn how to do something or you need to find a few different options for the way forward. When this happens, it can be helpful to separate from each other for a certain amount of time 20 — 30 minutes and come back together to share what you’ve learned afterwards.
This is an activity especially good for leveraging people’s different ways of solving problems. There is something in separating for a short period but then coming back together that brings out creative answers.
Watch the time zone pain
Remote pair programming is now totally possible, but it’s important to watch the timezones when setting up pairing. Pairing is best in 3 — 4 hour sessions which makes it a natural fit for morning or afternoon. Once timezones are involved, it can be difficult for a pair spread across lunchtimes. it might be that the pair takes two 30 minute breaks instead or plans on one session of pairing per day instead of two.
Even if a pair restricts itself to one session of four hours a day, the pair will still be accomplishing quite a lot and there is always something to catch up on or meetings to attend during the other part of the day.
Note: requiring someone to time-shift out of a regular workday so that they can program with someone 12 hours away is a sign you need to do something else. Co-locate the pair or re-think how the project is set up.
Pairs are made up of people
The theme here is that the people in a pair are just that…people! As humans there are times when we need to take breaks to eat, sleep and sometimes, simply take a quiet break for reclaiming our own headspace.
Pair programming has many benefits but it is intense and takes a lot of energy. The burn out struggle is real and people will need breaks. Finding some breathing room where your team needs it is an important aspect of adopting pair programming and will help your team to keep going with it.