Pair Programming: what works for me and what doesn’t

December 4, 2007

Pair programming was one of the two biggest challenges I encountered when I started my current job (the other being TDD) . How would I react to someone staring at my screen 8 hours a day – would I be distracted, or driven to working better? How would I react to staring at someone else type for 8 hours – would I stay focused or would my mind drift of its own accord?

It took me about 2 months to get reasonably comfortable with the practice. Now I enthusiastically recommend the practice to anyone who will listen to me (and the same goes for TDD). The list below are general practices that work and don’t work for me, but there are exceptions to the rule. The dynamic you establish with each pair is different – what’s important is that the pair is comfortable with the understanding between each other. So, without further ado:

The Good

  • The code is never written by one individual. Share the knowledge, share the joy, share the pain.
  • Programmers are inherently lazy. If they can skip good programming practices to finish a task early, they will. Your pair keeps you honest.
  • You learn tons of tips and tricks by watching someone else code – IDE shortcuts, plugins you never knew existed, new programming techniques, understanding the way someone else thinks.
  • Someone to talk things over with when you don’t know how to proceed.
  • Debugging a problem.
  • If you aren’t driving, pairing lets you think ahead.
  • If both individuals are on the same page, I generally prefer the “passenger” to stay two steps ahead and constantly offer suggestions or directions. Alternatively, to stay quiet and observe the action.

The Bad

  • Like anything, pairing can become a dogma. You don’t have to, not for very trivial tasks.

The Ugly (ie. my personal quirks or things I need to work on)

  • On average, I need about 4-6 hours a week working on tasks by myself. Without that personal time and space, I get cranky.
  • There are moments when I need to think quietly to clear thoughts and ideas in your head. If I’m not driving, I get the chance to. If I’m driving but my pair understands how to proceed, I let him drive. If I’m driving and neither one sees a clear path to the solution, the general approach is to discuss an approach with each other. I am not a “thinking out loud” kind of person; so I cringe at these moments.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: