Roles

Driver - the one who has the keyboard. Focused on a current task solving tactical problems. Talks through what he is doing.

Navigator - observes and shares thoughts. Makes notes about next steps and possible issues. Tries not to interrupt the Driver.

Activities

Things that you should do apart from coding.

  1. Understand the problem - write down the Definition of Ready
  2. Write down a list of questions for research
  3. Split this list between engineers
  4. After agreed time meet and discuss your answers
  5. Come up with a solution - brainstorming and sharing contexts
  6. Write down a list things that need to be documented
  7. Plan the work - step-by-step implementation notes
  8. Check calendar and plan around meetings
  9. Start pairing

Use time management techniques like Pomodoro to maintain focus.

Pairs should be rotated every 2-3 days avoid knowledge silos and increase collective code ownership.

Remote pairing

For a distributed team you can do pairing remotely, minimal setup requires only tmux and a great power of will.

  • Use video
  • Take care of good audio (quite space, noise cancellation, headphones)
  • Collaborative online tools for sketching
  • Switch sides time to time

Things to avoid

  • Drifting away - emails and messengers should wait until the next pause
  • Micro-Management - leave some space for driver to think
  • Impatience - wait for 5 seconds before commenting
  • Keyboard Hogging - makes it harder for the other person to focus

Benefits of Pair Programming

  • Knowledge sharing
  • Collective code ownership
  • Keeping focus
  • Code review on-the-go (Good addition to Continuous Integration)
  • Fast on-boarding

Pairing helps to eliminate boring, repetitive tasks by finding a right abstraction for bad code design.

While pairing you might feel vulnerable, because it shows your weak points along with strong sides. But this level of stress is actually an important ingredient for creativity.

Effective pairs

A successful pair includes ar least one person, that is proficient in the skill required for the task, following the Dreyfus skill acquisition stages model. The gap in the skill levels between pairing people should not be more than 1 stage. E.g. Novice - Proficient form a good pair, where Novice learns very fast. Collaborative work of an Expert and a Master results into brilliant masterpieces. But if you assign Novice and Master on the same - they will no be able to work together, the difference in perception of the subject is to big.


These are my notes from reading this article: https://martinfowler.com/articles/on-pair-programming.html