Dot Net Thoughts

October 6, 2007

My experience with paired programming

Filed under: Management — dotnetthoughts @ 7:08 am
Tags: , , ,

I’ve spent the better part of the morning trying to get my first WCF code sample to work. I got it to work eventually, but it took quite a bit more time than I was expecting. Instead of writing new code this week, I thought I’d record some of my recent experiences with paired programming.

Paired programming is simply placing two developers at a single workstation to write code. The thought process is that two heads approaching the same problem will have different experiences and perspectives on how to tackle it. While one person is writing code, the other is supposed to be thinking about the unit test and how the code might break. The philosophy recommends switching developers at the keyboard several times during the day. Research indicates that the total time to develop a system using the paired technique is relatively close to the same amount of time required for developers working individually. Code quality, however, improves greatly.

I’ve recently been working on a project with some pretty complex algorithmic calculations. I’ve been pairing with an architect for about four months, and I’ve come up with these thoughts for anybody considering pairing.

  1. Make sure you have a good personality match. The paired developers are going to be spending a lot of time in a small space together. My partner and I get along extremely well together, but there are still days where we want to throw each other out the window. If there are personality conflicts between the developers, they will probably be magnified significantly. Learn the strengths and weaknesses of your partner, and play to each others strengths as much as possible.
  2. Be flexible with the philosophy. True paired programming requires that both developers be there for each and every line of code that is written. Some teams may find that to be critical to their development process. We’ve fallen into a pattern of coding difficult sections paired, and easier secitons individually.
  3. It’s not called trio programming for a reason. Early on in the project, we had a third team member working on the same code we were working on. When any two of us were working together, it was a very clean, efficient day. When all three of us were in the room together, the additional voice added just enough chaos that our productivity fell significantly.
  4. Be prepared to defend your point of view. Typically, when my paired developer and I both have a conflict over the right way to do something, we will debate back and forth for awhile. It often turns out that both of our initial thoughts were wrong and we end up with a far superior way of solving the problem. Both team members must be willing to give and take on what the final code looks like. If one personality dominates, I think a lot of the benefit would be lost.
  5. Team programming is a good way to build team cohesion and consistency.When starting my last project, an entirely new team was brought on. We spent the entire first month, “team developing” our first module of code. This brought all of our coding standards in line with each other, and helped develop relationships very quickly.
  6. Try to keep ability levels similar. Mentoring is often talked about as one of the advantages of paired programming, and two developers can learn a lot from each other. I would advise caution when pairing two programmers together where one is significantly more senior than the other. The risk is that the junior programmer be overwhelmed or intimidated by the senior programmer, while the senior is frustrated with the development speed and thought process.
  7. Understand the effects of scheduling. If you are a shop that adheres 100% to the philosophy that both programmers need to be present for work to get done, you will have to have a plan for how to deal with sick days, vacations, doctor’s appointments, etc. This is one of the big reasons I recommend flexibility with the philosophy.
  8. Finally, keep a sense of humor. The world can start looking a little strange after being trapped in a room with the same person for hours on end. Enjoy the friendship and the development.

That’s all for today. Code safe!


Create a free website or blog at