Back to Overview

Pair Programming

Pair programming

If two people sit next to each other at the same computer and write code together, we call this Pair Programming.

We do not pair program 100% or even most of the time, but we believe that for certain problems pair programming is a very relevant and useful tool. It helps new members of a code base or section of the code base to hit the ground running and get started working in it as they are paired with a more seasoned developer. It likewise helps more junior developers help learn about how to work with tools or how to use them more effectively.

The result will likely be more highly polished code, as it was already signed off on by two people. Likewise, there is no better collaboration between designers, developers, or other stakeholders than at the keyboard.

When to do Pair Programming?

Rules for Pair Programming

  1. Agree on the scope of what you will do together (how long? just to get the baseline? all the way? for one hour?)
  2. Agree where and when, so you are both prepared and it is not too spontaneous and disruptive.
  3. Agree on how you will work, which tools (text editor, or other tools) or environment you will use.
  4. Agree on how to pair. Who will take the keyboard? Will you switch around, and if so when?
  5. Keep talking aloud and encourage and support each other.
  6. Remember to sometimes switch and keep both sides involved.
  7. Take a break if it goes on for a long time or you are both stuck.
  8. Give each other feedback afterwards on how it went.
  9. Split tasks clearly: For example, usually the developer at the keyboard is free to worry about the details and do the typing, and the other can focus on the broader picture, ideas and architecture.