Day 127 - Pairing

(I found some old posts lurking around as drafts, so I figured I might as well publish them. They're dated, but might be interesting anyway.)

Another thing that drew me to working for ThoughtWorks is their dedication to pairing. At almost every level of the organization, there is no single person responsible for any given thing. We all collaborate on everything we do. This is great for a number of reasons. First and foremost, it's excellent for mentoring somebody in a subject they're not familiar in.

Before working here I was largely a C# guy. C# is my best language, it's the one I'm most familiar with. On this project, the codebase is entirely Java and Javascript. Luckily, Java is similar enough to C# in syntax and structure that jumping into it hasn't been particularly difficult. It's been made even easier by working with my teammates who have far more familiarity with Java than I do.

When we pair program, we try to set things up like this:

Paired Programming Setup

We each get our own screen, and our own keyboard and mouse. As we each have a keyboard and mouse of our own, either of us can start driving at any time. We usually try to ping pong back and forth while working, which would go something like this:

  1. I'll write a test for a new function we're about to implement
  2. My pair will write the code to make that test pass
  3. My pair will in turn write the next test
  4. I'll write the code to make it pass
  5. Rinse
  6. Repeat

One of my favorite things about this approach is how focused it keeps me. If I'm working on something by myself and my mind wanders for a bit, it can take me a while to get myself back in the zone. When paired up with another developer, if I lose my place, they can just keep at it until I get my head back into the game. I also find it harder for me to lose focus in the first place when I'm pairing. Collaborating in this way keeps me far more focused for longer periods of time, which I absolutely love.