Guide to effective pair programming

It is important to understand how and when to do pair programming. I shared a copy of a document that I wrote to show the best practices of pair programming to my team. We are using it successfully in multiple teams now.

Read the document here: https://github.com/amad/pair-programming

There are a lot of benefits when you do it correctly.

  • Fewer mistakes.
  • Better design and decisions.
  • Faster to find problems and solve them.
  • Harder to procrastinate.
  • An effective way to share knowledge.
  • Best practices are always shared.
  • Better onboarding experience.

Pair programming is often confused with helping, collaboration and teamwork. It is easy to do it wrong and ineffective by not following the basic rules.

But as much as doing it right will give you many benefits, not doing it correctly has some side effects on your team.

It will end up being very inefficient and unproductive way of working that only increases man-hours comparing to working individually.

The navigator will get distracted more often and is less productive. In the long run, it will turn the environment/team-space into a counterproductive space for the navigator, and he/she will lose his/her performance after a while.

In one of my previous jobs, we had this common problem that every now and then someone was leaving with a lot of knowledge about the projects and leaving the team with significant knowledge gaps. Therefore we started to research, and we have decided to use pair-programming to improve knowledge sharing in our teams.

In the beginning, we did the pair-programming same way that many other teams are doing that. And after facing some pitfalls, we began to research and learn more about best practices of pair-programming.

And very soon we noticed all the other benefits. Not only knowledge sharing in the team was improved. We didn't have any knowledge gap or a project that only one person knows how it works.

Our teams could make better design decisions, and we needed considerably less time to make new developers productive.

This document is base on our experience doing pair-programming the right way.