Skip to content

Instantly share code, notes, and snippets.

@xtina-starr
Last active August 23, 2017 19:36
Show Gist options
  • Save xtina-starr/d298dd6f5a92b1be287322e2dc71eab4 to your computer and use it in GitHub Desktop.
Save xtina-starr/d298dd6f5a92b1be287322e2dc71eab4 to your computer and use it in GitHub Desktop.

Pair Programming

What is pair programming?

Pair programming is an agile software development technique in which two programmers work together at one workstation. One member, the driver, writes code while the other, the observer or navigator, reviews each line of code as it is typed in. The two people work together to design, code and test user stories.

  • perhaps talk about what pair programming looks like at Artsy today (ad-hoc).

Benefits of Pair Programming

  • Improve Quality - code review is done before or while the code is being written.
  • Lower Development Costs
  • Pair Learning (Knowledge Sharing)
  • Team Building

Pair Programming Styles

Driver-Navigator

The driver and navigator is the tradition style of pair progamming. In this style, one member, the Driver, has the keyboard and control of the input. Their job is to type and focus on the minute-to-minute coding. The other member is the Navigator and takes on the responsiblity of paying attention to the code being written as well as keeping in mind the bigger picture and guiding the driver in the right direction.

What makes a good driver:

What makes a good navigator:

Ping-Pong

In the ping-pong style of pair programming, one member of the pair takes the role of writing the tests while the other pair is responsible for making the test pass. If both pairs are particularly familiar with test driven development this is can be a successful style of pairing. Ping pong pairing can also work where the pair responsible for writing code to make the first test pass then immediately writes a test that the first pair will be responsible for adding code that passes and so on.

When Should You Pair

When Should You Break Off From Pairing

How to make pair programming successful

  • Discuss problem set and requirements up front to ensure they are well defined and both pairs have a clear understanding.
  • Communicate what you are thinking both driver and navigator.
  • Establish trust.
  • Be Patient.
  • Switch driver and navigator roles (every half hour).
  • Take breaks:
    • Take moments to celebrate as you complete tasks and overcome problems.
    • When the pair is blocked.
  • When an expert is paired with a novice, the expert should be prepared to play the role of mentor.
  • The person who knows less about the system or language should do most of the driving.

Live pair programming sess!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment