Pairing Patterns

Learning Goals

  • explain the purpose of pairing
  • apply simple pairing patterns like Driver/Navigator and ping-pong
  • verbally establish a productive pairing arrangement
  • give specific, actionable, and kind feedback to pair

Pair Programming

Setup

  • Switch to the directory where you keep your code
  • Clone the repo: git clone https://github.com/turingschool/code_retreat.git
  • cd code_retreat

Tools

During these sessions, you can try a few different tools:

  • Pairing on a laptop with one external keyboard
  • Pairing on a laptop with two external keyboards
  • Pairing with an external monitor and two keyboards

Session 1: Open Pairing

Let’s briefly warmup by pairing however you naturally see fit. Before you start, make sure to clarify with your pair exactly how you will be pairing.

Work for ~20 minutes.

Session 2: Driver-Navigator

In Driver-Navigator:

  • Person A does the thinking and talking, Person B does the syntax and typing
  • When a test/implementation cycle is completed, swap roles
  • Person B does the thinking and talking, Person A does the syntax and typing
  • When a test/implementation cycle is completed, swap roles
  • Continued…

Work for ~20 minutes, then provide your pair with feedback.

Session 3: Challenger

In Challenger:

  • Person A writes the first test
  • Person B writes an intentionally weak implementation (challenging the test from Person A)
  • Person B writes the next test
  • Person A writes an intentionally weak implementation
  • Person A writes the next test
  • Continued…

Other Patterns Ping-Pong

Next we’ll experiment with ping-pong pairing:

  • Person A writes a test
  • Person B writes an implementation
  • Person A writes a test
  • Person B writes an implementation
  • Continued…

At the end of this session, provide your pair with two pieces of feedback:

1) Something your pair did that they should continue. Why?

  • It was really helpful when you used pencil and paper to explain some concept to me so that I could visualize it before we tried to implement it in code.

  • I liked that you weren’t afraid to stop me to ask me to explain why I was doing something. By having to verbalize my thinking, I was able to identify some of my own gaps in knowledge.

2) Something your pair did that they should consider changing. Why?

  • You seem eager to figure out how to accomplish a task because you’re quick to try any solution you can think of until you find one that works. Sometimes, this makes it seem like you might not be thinking about why you’re doing something. Next time, let’s be more strategic in our choices. If you think of something that might work, I would like for you to explain your idea to me and let me know why you think it will work. That way, you can get feedback on your idea before trying it in code.

  • I can tell that you’re quick to pick up new things, but you sometimes leave me behind because I need a little more time to think about the problem that we’re trying to solve. It would help me if you could explain your thinking and implementation after each step so that I can keep up and contribute.

Make sure your feedback is specific, actionable, and kind.

SMART Feedback: Specific, Measurable, Achievable, Related to Task, Time-Based