Jeffrey Palermo
Pair programming is a great way for real-time code review and collaboration. Chances are that the end goal will be reached more quickly by working with a partner when writing software...."> Palermo's rules for Pairing (pair programming, that is) - level 200 - Jeffrey Palermo (.com) - CodeBetter.Com - Stuff you need to Code Better!
 
Jeffrey Palermo (.com)

Sponsors

The Lounge

News

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
Palermo's rules for Pairing (pair programming, that is) - level 200
Palermo's rules for Pairing:
Pair programming is a great way for real-time code review and collaboration.  Chances are that the end goal will be reached more quickly by working with a partner when writing software.  This might sound counter-intuitive at first if you think that 2 people splitting the work would accomplish the goal faster.  What actually happens very often is that, without communication, work is duplicated, or people code is slightly different directions.  I'm won't pander to the benefits of pair programming too much, but when pairing, here are my rules:
  • Talk while you code.  Explain the thought process that is leading you to type what you are typing.
  • Play the TDD game.  Have one person write a test, then pass the keyboard so that other other person makes the test pass.  The person who gets the test to pass decides if he wants to write a test next or pass the keyboard.
  • If both programmers aren't on the same page for the task, whiteboard it to form a common understanding.
  • Commit the code to source control after each task is completed.
  • When working in a team of more than 2, rotate pairs so that knowledge flows.
  • If one of the programmers is a clear novice on the task, have him drive first until he's no longer the novice.
  • Don't steal the keyboard.  If you know of a better way to accomplish a task, explain your thought process so that your partner understands the better way.
  • Defer driving.  If you are completely comfortable with the code that is about to be written, pass the keyboard to your partner.  Writing the code will benefit him more than you.
  • Communicate.  It's tought, and there will be disagreements.  No one has overruling authority.  If you haven't convinced the other of your viewpoint, you haven't communicated it effectively.  If it's important, then everyone on the team must understand why.
  • Communicate.
  • Communicate.

Posted 02-20-2006 1:06 PM by Jeffrey Palermo
Filed under:

[Advertisement]

Comments

Sam Gentile wrote New and Notable 94
on 02-20-2006 7:20 PM
<p>My apologies to my readers and my CodeBetter colleagues on one more link posting without original material. I have had an intense couple of weeks and the For Sale sign went up on my NH house today as we get ready to move states. I still promise to have my CAB and Spikes post up real soon-)</p>
Sam Gentile wrote New and Notable 94
on 02-20-2006 10:27 PM
<p>My apologies to my readers and my CodeBetter colleagues on one more link posting without original material. I have had an intense couple of weeks and the For Sale sign went up on my NH house today as we get ready to move states. I still promise to have my CAB and Spikes post up real soon-)</p>
Sam Gentile wrote New and Notable 94
on 02-21-2006 8:24 AM
<p>My apologies to my readers and my CodeBetter colleagues on one more link posting without original material. I have had an intense couple of weeks and the For Sale sign went up on my NH house today as we get ready to move states. I still promise to have my CAB and Spikes post up real soon-)</p>
Jason Haley wrote Interesting Finds
on 02-21-2006 8:36 AM
Sam Gentile wrote New and Notable 94
on 02-23-2006 11:13 PM
<p>My apologies to my readers and my CodeBetter colleagues on one more link posting without original material. I have had an intense couple of weeks and the For Sale sign went up on my NH house today as we get ready to move states. I still promise to have my CAB and Spikes post up real soon-)</p>