Wednesday, October 22, 2008

Why Pair Programming Should be made MANDATORY

Pair Programming is one of the most controversial topics discussed time and again. In the beginning I was a bit hesitant about this practice, but slowly I got used to this and really enjoyed working with another developer. However, when in one of my projects, I was the sole developer for nearly months, I knew how important it is for us to really have another pair of eyes. The few months I worked alone, I was not myself at all. Even though I had the opportunity to learn all the latest and the greatest technologies, I just couldn't take it anymore. I had to resign and so did I.

Now that I am reading the book "Pragmatic Thinking and Learning
", I was able to clearly understand why I felt the way I was in that Job working alone. In Chapter 4: Get In Your Right Mind Andy explains about Pair Programming and why it is important. He first explains about the R-Mode and the L-Mode of our brain. So, you may ask what is R-Mode and L-Mode:


If you're looking for global, holistic patterns, you need R-mode. If you need to analyze parts and look into detail, then you need a more L-mode approach. For most of us, this level of specialization is how it is. R-mode sees the forest; L-mode sees the tress.


For pair programming, Andy very well explains that we need to get both R-mode and L-mode working together, and the only way to do this is by having your L-mode work with another person's R-mode or their R-mode work with your L-mode.

Again,to quote from this excellent book:

The navigator is free to see these larger relationships and the larger picture, And most of the time, you cannot see these relationships if you're driving. So if you aren't pair programming, you definitely need to stop every so often and step away from the keyboard.


This doesn't mean that you should pair all the 8 hours you are working. I suggest we should pair when we are working on a critical piece of our module, when we are trying to fix bugs, learn a new language, writing build files. Always better to have another pair of eyes, and another mode of brain.

What do you think? Are you using Pair Programming at all? What are your thoughts?

6 comments:

  1. I believe completely in pair problem solving. programming to me can be a solitary effort because I've noticed that every day coding isn't that difficult and doesn't require two minds to solve.

    PPS > PP!

    ReplyDelete
  2. I am a big advocate on pair programming and, although, most of the time I work alone on a PC, but when there comes a case that I know would be done much faster and of more quality and less error prone, I ask my coworker for one more pair of eyes and advice that he can give me during working on a critical thing. The coworker is actually the project manager, but he also does anything that is needed to be done in the project, also coding sometimes and mentoring.

    ReplyDelete
  3. The negative side of PP is that you must focus on the work 100% of time. No ICQ, no reading of interesting articles while code compiles, etc...

    ReplyDelete
  4. Just one ideological, anti individualistic solution. Nothing should ever be made mandatory except the law of the land.

    ReplyDelete
  5. I've seen a couple of articles that advocate following a software development rhythm... do a bit of solo programming, then pair up, some more solo programming, followed by more pair programming.

    The rhythm helps developers keep up pace when they work solo and deal with more challenging issues when working as a pair.

    ReplyDelete
  6. (I know it's an old post, but anyway): I think pair programming must be absolutely voluntary. If the two people involved don't harmonize, mandatory pair programming will make project progress grind to a virtual halt. When two people work on a project, they should get the opportunity to decide for themselves if their work relationship allows pair programming, or if the project would be better of with more clearly defined boundaries and e.g. a periodic mutual review

    ReplyDelete