This is the transcript of the podcast, download it here.

Hello and welcome to the forth episode of the Agile Podcast. I’m André Faria your host. Let’s talk about pair programming today.

Pair programming is an agile software development practice in which two programmers work together at one work station. One types in code, while the other reviews each line of code as it is typed in. The person typing is called the driver, and the person reviewing the code is called the navigator. The two programmers should switch roles frequently.

Pair Programming By Improve It

Pair Programming By Improve It

Let’s see some benefits of pair programming according to the c2 wiki.

1. Focus and discipline: Pairing partners are more likely to “do the right thing” and are less likely to take long breaks. You know, when we are alone, working in a computer there are many things that can distract us from the actual work that we should be focused. Twitter, e-mail, blogs… Working with somebody else tends to help us to not get distracted.

2. Better code: Pairing partners tend to come up with higher quality designs.

3. Improved morale: Pair programming, done well, is much more enjoyable than programming alone, done well. (On the other hand, pair programming done poorly is much less enjoyable than programming alone done poorly.)

4. Collective code ownership: When everyone on a project is Pair Programming, and pairs rotate frequently, everybody gains a working knowledge of the entire codebase. Have you ever worked in a project that just one developer knew how to deal with some piece of code? Well, pair programming really avoid this kind of problems.

5. Mentoring: Everyone, even junior programmers, has knowledge that others don’t. Pair programming is a painless way of spreading that knowledge.

6. Fewer interruptions: People are more reluctant to interrupt a pair than they are to interrupt someone working alone.

The most important benefit in my option is synergy effect. It’s like Gramma use to say: “two heads are better than one”. What I mean is that working in pairs, the two programmers are able to produce code that alone they wouldn’t.

According the Extreme Programming website, pairing is a social skill that takes time to learn. 
 Don’t expect people to be good at it from the start. It helps if you have someone on your team with experience to show everyone what it should feel like.

Ping Pong Pairing

Alexandre Martins wrote in his blog about a very interesting technique to make pair programming even more fun and totally integrated with Test Driven Development. It’s called Ping Pong Pairing.

It happens when the developer 1 from a pair implements a test for a given feature and see it failing, then passes the keyboard to developer 2 who makes the test pass, do some refactoring on the code and implements another test, passing the keyboard back to developer 1 to do the same thing and continue until the feature is done.

This really makes programming funnier and more dynamic . It is worth a try!

Well, I guess that’s all for today. Thank you very much for listen, and please post your comments, questions and feedback. Let me know what you think. I’m André Faria, great to have you listening. I’ll talk too you again next week.