Skip to content

The dirty secret of pair programming

September 22, 2009 by Mendelt Siebenga

Pair programming is one of the more controversial extreme programming practices. Having two people work on the same piece of code at the same time looks very unpractical and inefficient to someone not familiar with this practice. Pair programming proponents like me are usually quick to point out the benefits like improved quality, less rework, better communication and better knowledge sharing within teams but I think the biggest reason pair programming works is usually kept quiet.

People work harder when there is someone looking over their shoulder.

I'm going to be completely honest with you here. When I work alone I spend a considerable amount of time surfing the web, reading email, twittering (you can follow me at @mendelt) getting coffee and talking to coworkers. This means I'm spending less time working but it also means I'm constantly interrupting myself during the time I am doing work making me even less productive.

Now we don't tell our managers this because it wouldn't do anyone much good, the problem is a bit more complex than just people slacking off. What I've observed is most people have a hard time pacing themselves. We do really focused work for five minutes and then take a break. Unfortunately breaks have a habit of taking more time than they should and productivity goes out the window.

To solve this problem we need a way to maintain a sustainable pace. Pair programming is a way to do just this. Forcing yourself to explain what you do to your pair is a great way to maintain a sustainable pace and work a bit harder.

About the Author: Mendelt Siebenga has been working as a software developer for close to ten years. For the last five years he has been applying practices and ideas from XP, Scrum and Lean in several adverse conditions like in fixed-price projects, teams distributed over several timezones and even during a SOX compliance implementation.

Comments

You are the first one to admit it publicly ;-)

September 22, 2009 by sginter, 25 weeks 16 hours ago
Comment id: 3537

I can't pair program so I started experimenting with pomodoro to pace myself, with a ticker ticking in my headphones to help me stay focused.

I won't tell you how many effective pomodoros (25 uninterrupted minutes) I get daily, I don't want to get fired ;-)

So True

September 22, 2009 by Gregory Kornblum (not verified), 25 weeks 14 hours ago
Comment id: 3541

I wouldn't be writing this comment if it wasn't.

Couldn't agree with you more

September 22, 2009 by elebaron (not verified), 25 weeks 14 hours ago
Comment id: 3542

The fact that I am reading and responding to this is evidence of my lack of sustained productivity.

When I work by myself (in the office), I'm lucky to get 30 minutes of real work done every hour (some due to interruptions beyond my control, some due to my own lack of focus).

Top Blog

September 23, 2009 by The Daily Reviewer (not verified), 25 weeks 4 min ago
Comment id: 3545

Hi!

Congratulations! Your readers have submitted and voted for your blog at The Daily Reviewer. We compiled an exclusive list of the Top 100 Programming Blogs, and we are glad to let you know that your blog was included! You can see it at http://thedailyreviewer.com/top/programming

You can claim your Top 100 Blogs Award here : http://thedailyreviewer.com/pages/badges/programming

P.S. This is a one-time notice to let you know your blog was included in one of our Top 100 Blog categories. You might get notices if you are listed in two or more categories.

P.P.S. If for some reason you want your blog removed from our list, just send an email to angelina@thedailyreviewer.com with the subject line "REMOVE" and the link to your blog in the body of the message.

Cheers!

Angelina Mizaki
Selection Committee President
The Daily Reviewer
http://thedailyreviewer.com

Have a look at the Pomodoro

September 23, 2009 by Anonymous (not verified), 24 weeks 6 days ago
Comment id: 3546

Have a look at the Pomodoro technique. You can work alone and be productive.

Rubbish

September 23, 2009 by Anonymous (not verified), 24 weeks 6 days ago
Comment id: 3547

What a load of piffle. I have seen some very unproductive single programmers who waste at least two hours a day. However, when I watch large groups of pair programmers I see far more waste than this. Quite often one person out of the pair is almost entirely waste and the other person in the pair still wastes a couple of hours anyway.

1 + 1 = 0

September 23, 2009 by Anonymous (not verified), 24 weeks 6 days ago
Comment id: 3548

1 + 1 = 0

Not Always

September 23, 2009 by Anonymous (not verified), 24 weeks 6 days ago
Comment id: 3549

You haven't met the guys I used to work with who spent most of their time making fart jokes and imitating Office Space characters whenever they got together.

You also haven't met the dedicated and passionate, and very bright programmers I've known who work very hard by themselves and would be slowed down by working with a partner.

In short, you're stereotyping here.

Article title killed me for 5

September 23, 2009 by Cyril A. Karpenko (not verified), 24 weeks 6 days ago
Comment id: 3551

Article title killed me for 5 minutes :-D

Really, it's often no people behind your back to make work process stable and continuity. It's another one thing which give pair programming idea few sense in my mind, after knowledge sharing concept =)

Thanks!

September 24, 2009 by Mendelt, 24 weeks 5 days ago
Comment id: 3559

Thanks for the reactions. I did expect more negative ones though :-)

1 + 1 = 0 is of course nonsense. In the case of pair programming the fear is usually that 1 + 1 = 1 (two people doing the work of one). In my experience with pair programming 1 + 1 >= 2 in almost all cases. There are of course exceptions to every rule. But if you focus on the exceptions you can probably dismiss any practice.

I wrote this post to show there are down to earth reasons why pair programming is an effective way to do work immediately. It's a more social way to keep people focussed on their work. I do agree with Cyril A. Karpenko that on the long run improvements in knowledge sharing (and code quality) will far outweigh this short term benefit.

Of course like any practice it's still a tool in a toolbox. Don't use it because I say so but use it because you've made yourself familliar with the pro's and the cons and see a benefit.

There are other tools like the pomodoro technique, thanks sginter and Anonymous for bringing that up, that have similar benefits. I've used the pomodoro technique myself and am very happy with the results. I have to say I got the best results combining pomodoro with pair programming though.

One of the things I did notice was that people automatically assume that 'good programmers' are automatically the ones with enough self discipline to structure their work. I don't think this is always the case. Many very creative, very intelligent programmers are terrible at doing this. Pairing is a great way to get them to share their knowledge and at the same time get them more focussed.

French translation

September 25, 2009 by Fabrice Aimetti (not verified), 24 weeks 5 days ago
Comment id: 3571

Hi Mendelt, I completely agree with your post and comments. I've translated it in french : Le secret honteux de la programmation en binôme. Regards, Fabrice.

Hi Fabrice, Thanks for

September 29, 2009 by Mendelt, 24 weeks 19 hours ago
Comment id: 3589

Hi Fabrice,

Thanks for translating! Your French is clearly a lot better than mine :-) It never ceases to amaze me how showing a little trust by releasing material under a creative commons license for example generates so much more value because it allows people to add to the original.

Couldn't agree with you...

November 15, 2009 by Everyone (not verified), 17 weeks 3 days ago
Comment id: 4099

Whilst I concur, it's also important to note that a interruptions force a mental context-switch that may take as long as 10 minutes to get thoughts 'in the groove' again.

If you're interrupted for 10 minutes, you may actually lose 20 minutes.

The suggestion is unsolicited, but if I were you I'd try to tell my peers/colleagues to approach me with their concerns at a particular time of the day; unless they thought it was critical.

What do you say?

I agree and I think there is something else going on also

December 8, 2009 by Richard Cohen (not verified), 14 weeks 11 hours ago
Comment id: 4295

Hi Mendelt,

Thanks for being so honest. I agree with you but I have also noticed that it is more difficult to interupt two developers working together than one. This seems to keep co-workers and bosses out of the way. I guess it's just human nature , it seems rude to butt in on a conversation (which pair programming seems to be) while it's real easy to start a conversation when somebody is alone.

That's my 2 cents.

Pair-Programs

December 9, 2009 by KMan (not verified), 14 weeks 19 min ago
Comment id: 4296

Couldn't agree more. But pair working on a same peice of code at a given moment of time somewhat seems conflicting. Plus who would want to "sacrifice" their 10-minutes(tending to 20) break, or their coffee, or the gossips around? I mean, what exactly would motivate us for the Pair programming? One thing could be... the "appreciation" that the pair may get from the management? that may let them continue to Program-Pair'ly. Just thinkin out loud...

Impeccable

January 3, 2010 by Nginja (not verified), 10 weeks 2 days ago
Comment id: 4785

I think many scholars highly appreciate this technique despite anything else,
You don't have to worry about the Skeptics, nobody is asking anybody to approve anything-you can adopt it or not period- no politicking.

Painfully true.

February 17, 2010 by James Peckham (not verified), 4 weeks 6 hours ago
Comment id: 5513

usually the biggest complaint against pairing isn't the productivity drain though. it's 'different priorities' for different people. Uniting people on a common priority will probably get people to pair up more often.

Where i work right now every single developer has their own priority. so why would they want to go pair with someone else why their work slips a date?

ok

March 4, 2010 by masini, 1 week 5 days ago
Comment id: 5674

Yes it is dirty but are very good. piese autoThat is my opinion

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <b> <i> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <br> <blockquote>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]".

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters (without spaces) shown in the image.

Best of AgileSoftwareDevelopment.com