Skip to content
Code On!

When Pair Programming Works

When Pair Programming Works

2min read

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 finding out what works for you.

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

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

In all of those cases, PP came 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:

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

  • sharing knowledge - the more experienced 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

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

  • can be exhausting
  • 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.