A Recipe For Successful Pair Programming
This recipe outlines the basic ingredients and some of our secret sauce for a successful and productive pairing session.
This post was written by Avery Yen and Bella Bai, software engineers at Pivotal Labs.
At Pivotal, people ask us all the time about pair programming. It’s a big thing we’re known for. But pair programming isn’t just putting two programmers in front of a computer! This recipe outlines the basic ingredients and some of our secret sauce for a successful and productive pairing session.
Recipe
Serving size: One Pair
Ingredients
- 2 Engineers
- 1 Computer
- 2 Mice
- 2 Keyboards
- 2 Monitors
- 1 Codebase
- 1 Problem to solve
Secret Sauce
- Honesty
- Empathy
- Trust
- Constant communication
- Fast feedback
- Regular breaks
- Sharing
- Kindness
Directions
- Set up the computer so that both monitors show a mirrored display, and each mouse and keyboard is able to control it.
- Select any other engineer as your pair.
- Pick the team’s highest priority problem to work on.
- Talk with your pair about how you should tackle the problem. You will need to agree on a direction before any code can get written!
- Take turns sharing control of the mouse and keyboard, constantly communicating your thoughts when you have them, and helping each other to solve the problem at hand.
- When you run into a disagreement, stop coding and have an honest chat about the pros and cons of each possible direction. You may pull in another pair to chat about technical decisions, or talk to a product manager or designer to check your understanding of the problem.
- Trust your pair’s solution and try it out together so you can get fast feedback about whether it’s the right direction.
- If your pair asks for a break, take one. Maybe play ping-pong. After all, pairing is caring!
- Repeat steps 4–9 as needed throughout the day. Mix up for breaks: eat lunch, maybe take a walk, or grab a coffee.
- If your code is ready, deliver it and celebrate success together!
What it’s Like to Pair for a Year
Common comments
Internet Critic comments: I feel like there’s no way pairing can be more effective than two smart developers working separately. What gives?
Avery & Bella reply: The secret about the secret sauce of pairing — empathy, trust, constant communication, fast feedback, etc. — is that it isn’t a secret! These qualities will help any team be more effective at working together to solve problems and deliver better products faster. If a team isn’t pairing, they often need to spend lots of additional time and effort to build a cooperative environment. We think these qualities are essential to effective and productive software development. Pairing is a great way to build this into your discipline every day. A client engineer on one of our most recent projects said, “Pairing surprised me with how quickly we were able to deliver without any previous experience on the project.” He was also delighted with how, when working collaboratively, we quickly socialized technical issues and noted them down to work on later, rather than sweep them under the rug like he might have done in the past. Not only were we ramping him up quickly, we were paving the way for a future of delivering quality code at a rapid pace.
Super Hacker comments: What if I’m pairing and I really need to check my email or Facebook? I don’t want my pair snooping on my personal info!
Avery & Bella reply: We work hard to limit the need for any one team member to need to respond to email or other messages. Read: no meetings except the essential ones (stand-up and retro mostly). If you need to check your messages, get on Facebook, or whatever else you need, tell your pair you need a break during the day. But pairing requires a lot of focus and lack of distractions, which lets you and your team be more productive during working hours.
Anon E. Mouse comments: Help! I really want to try this recipe, but my developers aren’t co-located. What do I do?
Avery & Bella reply: Sometimes, your developers may not be able to sit together at one computer. While this is less ideal, it can be solved by substituting one computer with two computers, each with a webcam, high-quality headphones, and screen-sharing software. A whole monitor dedicated to just your pair’s face is especially effective.
Concerned Pair comments: I’m new to my team and I’m always afraid I will just slow down my pair. Should I just take some time alone to ramp up before trying to pair?
Avery & Bella reply: Pairing is not just for people who are experienced pair programmers, but we find it’s also equally effective at turning an inexperienced teammate into an experienced one. When paired with a more experienced teammate, you’ll be effective at delivering software on day one, and even more effective on day 100!
Now we want to hear from you, all the pairs out there:
Do you have variations on what makes for successful pairing at your organization? What are some parts of pairing you struggle with?
Change is the only constant, so individuals, institutions, and businesses must be Built to Adapt. At Pivotal, we believe change should be expected, embraced, and incorporated continuously through development and innovation, because good software is never finished.
A Recipe for Successful Pair Programming was originally published in Built to Adapt on Medium, where people are continuing the conversation by highlighting and responding to this story.