Small intro to “Pair Programming”
Hi guys, some of teams, that I have been helping lately, identified a lack of knowledge as a problem in some parts of our product. To tackle this issue, they decided to start with “Pair Programming”. Previously, they never did it so they asked me for some guidance where and how to start. That´s why I am writing a small intro to a “Pair Programming”.
As Rachel and Liz said in their book: “Pair programming is two people working together- at the same computer, solving the same problem. Each person plays an active role in creating the software; the person actively typing is known as the driver, and her/his partner is the navigator who looks ahead to consider next steps and potential pitfalls. Pairs swap fluidly between these roles.”
If your team adopts “Pair Programming”, these are some of the advantages that you will benefit from:
- Code is higher in quality, because it is constantly being reviewed
- Good practices are shared more widely among the team
- Developers are interrupted less, because people tend not to interrupt people working together
- More than one developer knows each part of the code
- Team bonding improves, because the team learns from each other and enjoys working together
But what should be done during the Pair Programming session?
First, when you are driving, demonstrate that an important aspect of pair programming is explaining what you are doing and why, so don´t just type code in silence.
Second, stay open for suggestions from your pair, even if they are novice programmers. Even though you see a very obvious solution, be willing to try the solution that your pair suggests. In any case, both will learn. If the solution of your pair is wrong, he/she will learn why it is wrong with a help of your explanation. If the solution is good, then you will learn new aspects with your novice colleague :).
Third, one person shouldn´t use the keyboard for more than ten minutes at a time. Using ping pong programming can be a good approach. More information about ping pong programming here.
One big mistake that is common in “Pair programming” is the fact that only one person does all the job. A lot of interaction between pairs should be observed. Interactive pairing forces pairs moving keyboard back and forward several times. In the beginning pair programming can be frustrating. Most of the time it means that developers will slow down to help colleagues but on the long term this is a tremendous help for the team itself.
This was a brief introduction to the “Pair Programming” . Naturally, this post itself is not enough but at least gives an idea about what “Pair Programming” is. If you want to know more resources about pair programming, just let me know.
I would love to get a star rating for this post:
From my experience pair programming can be very rewarding or very annoying. One practice we’ve tried in the past more or less successfully was the ping-pong programming that you mentioned. It works really well with test-driven development. You start with a broken test case, pass the keyboard to the pair. The pair fixes the test case and writes next test case for you to fix, and so on.
One of the challenges we’re facing now is that our entire office is brand new, so we have nobody who knows the platform really well. It would be nice to work in pairs with experienced developers from other locations but I’m not sure if it’s possible considering the remoteness and time differences.
If you like this, also check out Sal’s Blog on PairProgramming. Sal has done lots of research on pairing years ago and is republishing it now on a blog
http://salfreudenberg.wordpress.com/
Thank you so much Yves ;).
For sure I will take a look ;)
Luis