Pair Programming is very powerful and often very misunderstood. I highly recommend reading Pair Programming Illuminated as a starting point. As you begin to get a feel for pairing, review the tips below. They’re a combination of ideas from Pair Programming Illuminated and my own personal experiences pairing on production code for multiple internal projects and customer-facing products over several years.
Pair Programming Tips
The 7 Synergistic Behaviors
Observe that your getting the most out of the seven Synergistic Behaviors:
- Pair Pressure – Positive encouragement = not wanting to let partner down + satisfaction of working harder & smarter than you would alone
- Pair Negotiation – Combining two sets of skills for design & implementation to yield the best solution that fits
- Pair Courage – Advantage of not being alone in a challenging task, trying together what you might not alone
- Pair Review – Continuous review of design & implementation that happens in context and is more likely to be acted upon
- Pair Debugging – Going from problem identification to fix in a more enjoyable and often far shorter way than an individual might do it
- Pair Learning – Acquiring and/or improving skills while delivering value through working with another
- Pair Trust – Becoming more confident in each other’s skills and communication to present the best ideas because they feel supported
If you find these synergies are weak or lacking, reflect on what you can do to improve your pairing experiences.
Typically for Test Driven Development
- Driver creates test class and/or initial failing test with navigators’ help.
- Switch roles!
- New driver makes test pass with new navigators’ help.
- Pair negotiates possible refactoring and code check-in, and executes it if they are agreed.
- Repeat until you need a break.
Beat the Clock
A good way to enforce pace and limit keyboard hogs
- Grab a physical or virtual timer (Smart Phone, System Tray Application, etc.).
- Decide who will be the driver first.
- Set the timer & let the driver get as far as they can with the navigators’ help.
- Switch driver & navigator.
- Repeat until you need a break.
For advanced pairing practitioners
Someone starts driving, then the pair switches roles as needed, so long as Synergies don’t stop.
- Decide on a Story & Task.
- Decide initially on how much you want to pair (time spent and/or progress).
- Decide initially on a Pairing Game to use.
- Play your Pairing Game.
- Decide to continue (goto #1), switch pairs, or stop.
Try the following:
Say “I think…” to propose an idea.
Ask “Do we agree…” to confirm agreement.
Say “We agree…” to discuss progress towards goals.
Avoid saying “No, but…” Instead try saying, “Yes and…”
Ask “What would it take to get you in…” if your pair disagrees with a proposed idea.
The 4 “C”’s
- Communication: Do you agree you’re both communicating well with each other?
- Comfort: Are you two both comfortable with the context you’re working in?
- Confidence: Are you confident in your skills and your teams’, or at least voiced fears?
- Compromise: Are you willing to make compromises in order to make progress?
- Turn on line numbers in an IDE or text editor if available. It makes it easier for the navigator and driver both to reference sections of code in discussion.
- ASK for mouse/keyboard control, don’t fight!
- Remember to point with your mouse, not at the screen when using mirrored monitors.
- Remote pairing should not only be desktop sharing & voice. A significant portion of human communication is nonverbal, so add video chat to your tools.