Achieve pair programming successfully
What is pair programming?
My answer used to be ‘Pair programming is two people working together at a single computer.’ However, now I know that it is so much more than that. Although it has not been adopted by all of the software industry, pair programming is vital for not just collaborative teamwork but also high-quality software. One of the very first programmers believed that pairing resulted in the best programs and best designs.
Betty Snyder and I, from the beginning, were a pair. And I believe that the best programs and designs are done by pairs, because you can criticise each other, and find each others errors, and use the best ideas.
Pair programming means that two people write code together on one computer/code. There are two important roles when pairing, the driver and the navigator.
How to pair
The driver is the person on the wheel, i.e. the keyboard typing the code and implementing it. The driver is focused on the smaller goals, ignoring the big picture. A driver should talk through what they are doing while doing it.
The Navigator is the observer, while the driver is typing. The navigator clearly communicates the strategy, keeps an eye on the larger issues, and bugs, and makes notes on potential obstacles.
One of the benefits of this role division is to have two different perspectives on the code. It is not recommended to be too strict or too lazy with the roles because that will cause issues. Both of these roles contribute thoughts, the driver points out bugs and proposes ideas, and the navigator works to be a clear and effective steward. Remember there is more than one solution don’t get too attached. Take the time and care to agree on practices and environment along with your agreed commit style. Aim to balance each role 50/50.
As a junior pair
You are the novice with the language, tool of the codebase, so it might feel like your understanding of the current task is lower than that or your pair. Remember we all have to start from somewhere and even when your pair has the same knowledge as yourself, be ready to challenge yourself. Make is clear when you do not understand something and most importantly communicate when you have and idea by asking the navigator to be the driver for a while. Be assertive and have confidence in your ideas.
As a senior pair
Choose a pace that your pair partner can maintain. Ensure that your partner feels comfortable enough to stop you when they have questions. This is a great opportunity to share your knowledge with you co-worker. Don’t confuse completing all the requirements quickly with learning. Remember expertise is knowing the right path to a solution and mastery is knowing all the wrong paths, and why they might look right.
Another important benefit of pairing is providing good feedback
What is giving good feedback? Giving your pair good feedback may look like this:
- Ask for permission first (it is very important to tell your pair that you want to provide them with some feedback)
- Offer a ‘main takeaway’ from you experience coding and the progress you made that day
- Feedback must be compassionate, actionable, clear and honest.
- Use language like ‘I feel…’, rather then ‘We should…’ or ‘You are…’
- Offer both positive and constructive feedback
Troublesome patterns to look out for when paring
- Drives most of the time
- Navigates while driving (in silence)
- Always talks for the pair during help requests
- Won’t try or agree with others' ideas
- Refuses or is unable to understand something they didn’t invent
- Uses rude language or crude
- Shows condescension
- Uses ‘-isms’
- Avoids the keyboard
- Has trouble giving feedback
- Has trouble asking to navigate
- Confuses watching correct implementation with learning how to implement it
- Can’t complete a repo’s bare minimum requirements alone after completing them in a pair
It is a skill to successfully pair program in this industry and although in the beginning it might be awkward and even intimidating you will soon see the results it produces. This is a way that you can develop team building skills. I highly recommend trying it for yourself. I am new at this, I will stumble and get stuck but I would be honored to pair with you. Happy programming.