7 best practice tips for remote pair programming

In traditional pair programming, two programmers sit at the same computer together. As one codes, the other reviews. But as the workplace becomes increasingly remote, this space-sharing practice is facing disruption.

Pair programming is a real-time collaborative exercise. Remote pair programming is a real-time collaborative exercise with the added hurdle of not being in the same place during communication.

To help with the shift to remote work, we’ve put together an outline of the top 7 best practice tips to meet the challenge of remote pair programming.


1.      Set expectations

The first thing pair programmers must do is set expectations and boundaries. You can’t just check to see if your partner is in the office or shift programming times around in person.

So, take the time to generate a shared understanding of what you each can, can’t, will, and won’t do.

For instance, when can you have your remote pair programming sessions, and when do you have other commitments?

(Sharing your work calendar and blocking out your breaks/meetings/the school run etc. can be a helpful tool to find the best collaboration time.)

Other examples of expectations to set involve what your sessions will look like. Are you expecting webcams on, or is voice enough? Are there any other ground rules you want to make clear? Who is the lead first, and when will you swap roles?


2.      Switch roles regularly

This brings us to tip two: regular role swaps.

Pair programming involves a lead programmer or a ‘driver’ and a second ‘observer’ or ‘navigator’.

The former writes the code and focuses on the micro challenge of each line of code. The latter, meanwhile, watches and discusses the code, while considering overarching goals and possible future issues.

Regular role swapping ensures that both programmers are applying their skills to both sides of the challenge. It also helps to keep the exercise engaging and challenging.

With remote pair programming, this role-swapping is particularly important. It keeps both programmers engaged in typing, and doesn’t allow one to take the observant role and stop paying full attention.

Set an alarm to remind you both to swap on your agreed-upon intervals.


3.      Stay engaged

The point of pair programming is to work together and learn from each other. But if you don’t stay engaged with the task, it doesn’t work. Once you lose focus and engagement, it’s easy to get lost. It then takes more effort to catch up. Additionally, a lack of engagement risks frustrating the other programmer, comes across as rude, and wastes time to boot.

With remote pair programming in particular, staying engaged can be easier said than done. Because you’re behind a screen, it’s harder to engage with the person you’re working with.

It’s good practice, then, to keep your camera on during sessions. (Particularly if you’re observing and not currently typing the code.) This visibility will help you by adding external motivation to stay focused.

You can also take steps to minimise the distractions that draw your focus. For example, put your phone in another room and block social media access during your sessions. Make sure your drink is full and you’ve used the bathroom before your remote session, and so on.

If you find yourself becoming fatigued, say that you need a break.


4.      Take regular breaks to recharge

This leads us to the next tip: set time for regular breaks.

Remote pair programming is an intense endeavour. It requires considerable mental energy to stay focused on the code, solve problems, and also handle the social/teamwork aspect.

As such, it’s important that you have regular breaks scheduled to avoid burnout and loss of focus.

It may seem counter-productive, but taking short, regular breaks to recharge will boost productivity – rather than slogging through with only half focus.


5.      Have solo work time

Tangentially related, with remote pair programming being such a high-mental-energy exercise, it’s beneficial to have solo work time set aside too.

Any tasks around the programming project that don’t require you both to complete it can be done solo. Examples include research or self-study. Such tasks will help to inform your programming, but don’t require you to work together.

Agree during your remote sessions on who is going to research a necessary topic, and take time at the start of the next session to discuss what you’ve learned.


6.      Ask questions

Pair programming is, essentially, programming out loud with a team member listening and commenting.

Remotely, this means you MUST have your microphone and speakers on. You cannot rely on text-based chat because it distracts from the typing and reading of the code.

If you are the leader, writing the code, you can verbalise what you’re doing and why. As the observer, though, you’ll need to find other ways to contribute and make your point. And a good method is to ask questions.

Questions help everyone contribute, and everyone learn. They’re a good way to point out alternatives without accusing anyone of doing something wrong or writing bad code.


7.      Start small and build

Remote pair programming can be a challenge. And the hardest part is getting started.

It’s harder to bounce off each other and get into a flow over the internet. So, the final best practice tip is to complete tasks in a way that starts with the smaller, easier tasks and builds up.

This removes the difficulty of the coding aspect while you get used to working together. Then, once you’re used to working remotely together, you can face the challenging coding.


Remote pair programming

Many of the best practice tips for remote pair programming are the same for in-person par programming. What’s different is the level of challenge in communication.

So, the ‘TL;DR’ of these tips is to prioritise making communication with each other from remote locations as easy as possible. The rest is code.


Useful links

What is pair programming? What is it good (and bad) for?

How to comment code meaningfully: a best practice guide

Rubber ducking: not just a funny phrase