| categories:dev
Pair programming
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.
- Understand the problem - write down the Definition of Ready
- Write down a list of questions for research
- Split this list between engineers
- After agreed time meet and discuss your answers
- Come up with a solution - brainstorming and sharing contexts
- Write down a list things that need to be documented
- Plan the work - step-by-step implementation notes
- Check calendar and plan around meetings
- 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