Pair Programming Primer
Pair programming, when done poorly, can be:
- exhausting
- uncomfortably intimate
- boring
- generally unpleasant
Here are some points to cover when introducing pairing to make it a positive
experience:
Collaboration
- Not just watching me code
- For a thought to go from your head into the computer, it must pass through
someone else's hands.
- If you're at the keyboard and have an idea, pass the keyboard to your pair
and walk them through it (instead of "just a sec." and then you're off in
your own world).
- Llewelyn Falco describes this as "Strong style
pairing".
- Disagreements: just try something
- When you disagree about approach, don't debate; choose one person's approach
(preferably the most junior of the pair) and try it out. If they're wrong,
reality will prove it. If they're right, you just learned something.
- This is discussed in this
anecdote.
- See also: Llewelyn Falco's "Strong style pairing" article (linked above), in
the "Ask for trust" section near the end.
- Attribution in version control
- Update your git config so both pairs' names appear in the git log.
git config --global user.name "Alex B. and Sarah L."
- Swapping roles
- At regular intervals (<30 minutes), switch roles with your partner. Set a
timer, but don't be dogmatic — if the navigator is just about to
finish a thought, let them do so.
- A version control commit is a natural time to have someone
else take control: you may find it helpful to work in small chunks that can
be started and finished in 20-30 minutes.
Comfort
- Attend to your personal needs
- You can get up and leave whenever you want, without offering an explanation.
- Consider using Pomodoros: 25 minutes of work, 3 minutes off.
- Unless you firmly establish this as your policy, you are likely to "power
through" when you feel you need a break because of some imagined social
expectation — you'll end up needlessly tired and ineffective.
- Ergonomics
- When you take your turn at the keyboard, take a moment to place it fully in
front of you (instead of leaning awkwardly out of your seat).
- Hygiene
- Consider each others' personal space: make sure there's enough room where
you're sitting that you're not right on top of each other (coughing and
sweating on each other)
- Consider keeping a bottle of hand sanitizer to use when handing off the
keyboard
Customization
More Reading
Something to add? Continue the conversation on Twitter
Written 2019-05