views:

275

answers:

5

This term seems to be quite in use in English-speaking communities. I'm curious what it is? Is it like two students code together on a single PC or what? Is this organization (whatever it is) is only used in US?

+11  A: 

Pair programming is one of the main practices in Extreme Programming (XP). It does literally mean two people working on one computer, usually one at the keyboard (often referred to as the driver) and a partner (referred to as the passenger or shotgun). It is reputed to improve productivity and the quality of the generated code as well as enforce group ownership of the code - another tenent of XP.

Martin Randall
Very interesting, thank you. Not sure if it will increase the quality if one is coding the other one is sleeping.
User
Actually studies show it does. Consider this. The driver and the passenger keep switching roles as required through the pair programming session. So its more of like two friends both wanting to drive the car but the other friend who is not driving is happy to correct his driver friend.
daanish.rumani
As an experienced pair programmer, I highly recommend two keyboards and two mice -- it's makes pair programming much more fluid than if you have to slide the keyboard back and forth.
Don McCaughey
Good pair programmers maintain an ongoing dialog as they work, sharing knowledge, ideas and opinions. If one member of a pair is sleeping the whole time, then you're not doing it right.
Don McCaughey
+5  A: 

When in doubt, ask Wikipedia: Pair Programming. The general idea is to have one person writing code while the other scans for mistakes and cohesiveness.

Chas. Owens
I kinda made experience that you only think when you do it personally, otherwise your brain is on hibernate. At least it is so with me.
User
Think of it as a live code review. You are constantly thinking of ways to make the code better.
Chas. Owens
+7  A: 

http://en.wikipedia.org/wiki/Pair_programming

Pair programming is a software development technique in which two programmers work together at one keyboard. One types in code while the other reviews each line of code as it's typed in. The person typing is called the driver. The person reviewing the code is called the observer[1] or navigator. The two programmers switch roles frequently (possibly every 30 minutes).

While reviewing, the observer also considers the strategic direction of the work, coming up with ideas for improvements and likely future problems to address. This frees the driver to focus all of his or her attention on the "tactical" aspects of completing the current task, using the observer as a safety net and guide.

Simucal
The way I understand it, pair programming also offers one aditional advantages in companies with high employee fluctuation: If one programmer leaves, there is still another guy who understands the code. It's built-in redundancy on a programmer level :-)
Adrian Grigore
So you basically make yourself redundant ... :-|
James Camfield
Well, knowledge sharing is a pretty common practice. You don't want to have large companies at the mercy of a single developer.
Simucal
+1  A: 

An extension of Pair Programming sometimes used by practitioners of Test Driven Development is Ping Pong Pairing.

Ping Pong Pairing works something like:

  • Write a failing test (developer A)
  • Implement code that makes the test pass then (optionally) Refactor (developer B)
  • Write a failing test (developer B)
  • Implement code that makes the test pass then (optionally) Refactor (developer A)
  • and so on...

One of the benefits of Ping Pong Pairing is that it's tough for either developer to sleep very long ;-)

JeffH
+1  A: 

Paired programming is when two developer work on the same story card sharing a single computer and keyboard. It is considered an extreme programming practice. Extreme programming takes something positive, in this case a code review, and takes it to the extreme. The benefits beyond the continuous code review are as follows:

  • Improved quality: A pair of active programmers working on the same story card will complete the card with less defects
  • Improved productivity: a pair is less likely to be slowed down if not outright blocked when solving a problem. Furthermore, it is harder to take an email or web vacation when you are working with a partner ... you don't want to let the partner down. You will solve the problem with a cleaner design and less lines of code when working as a pair
  • Eliminate silos of knowledge: With rotating pairs, you will learn application and domain business knowledge across the team. The team is less likely to be blocked because Sue when on vacation and no one else knows her code.
  • Knowledge Transfer: Rotating pairs teach new skills (engineering and domain) to each other as they work together. The level of the team will rise for everyone and the knowledge propagates through the team.
  • Team self selects: The team learns one anther's skills and will quickly weed out someone that is not performing.
Cam Wolff