When Pair Programming Works

Published on 04 September 2019

Pair Programming (PP) is one of the XP practices. Many modern software development companies use it in daily activities. On the other side in many places PP is treated as a waste of resources because the same result could be achieved with half of the effort. Software developers also have mixed feelings about this methodology, including me.

I strongly believe that software engineers need time for design, collaboration and learning. Depending on the individual (or organisation approach) PP can be applied in various combinations. The key to having a meaningful and efficient software development is in find out what works for you.

Recently I had quite a few situations where PP was extremely useful. That included:

  • sharing the knowledge
  • learning others by diving examples
  • programming instead of writing tech specs (acting as a proxy)

In all of those cases, PP cable up as a first choice, without any policies enforcements or procedures. We just felt this is the right approach to the problem.

For me a good PP session has the following attributes:

Good Pair Programming session attributes:

  • timeframe
  • clear goal/objective
  • treating each other with respect
  • politeness
  • quiet workspace (no co-work or open-space)

The benefits

  • sharing knowledge - the more experiences developer can explain the codebase and the project
  • generating ideas - discussion can lead to new options
  • co-piloting - the non-keyboard dev can be looking up API info or preparing assets which keep the keyboard dev cruising along without interruption
  • teaching - more than just knowledge-share on a project (which is important), pair programming lets junior programmers learn from more experienced programmers - or each other
  • communication training - each of the engineers has to explain verbally what he/she means

The downsides

Apart from pros, PP has also some cons. Here they are:

  • can be exahausting
  • requires team members synchronisation
  • requires fairly good communication skills and vocabulary

My advice is to apply PP when possible, but not all the time. PP should not be forced because it can scare others.