arjunrao
Published on
Tuesday, February 20, 2024

Effective Pair Programming

Pair programming is the act of multiple (generally two) people working in real-time to solve a coding problem. Pair programming is often used amongst teams to be able to solve problems their teams are asked to address. Some teams apply it as a blanket pattern, whereas others will use it more surgically based on the type of the problem.

One question that comes up is "How often should you pair program?" I think this varies quite a bit. It varies on the nature of the people on the team, the kind of work, the experience level, the comfort of the team etc etc.

The best type of pair programming in a high performing team is a bit of a paradox. My sample set of senior staff or high performing individuals on a team, prefer to be uninterrupted during their day and go heads-down when they want to accomplish a task. On the other hand, the ideal form of pair programming is where you don't have an imbalance of power i.e. it is not a teacher/student type of relationship, but instead you have a beehive sort of dynamic. Where everyone is individually responsible for something in a way that is nearly equal, and is nearly just as taxing.

That balance of power or knowledge, the dynamic I am alluding to, is fairly crucial for everyone to have a good experience while pair programming. In my experience, it tends to work best with peers or near-peers programming together, but tends to break down once there is a bigger difference in experience or talent. This isn't casting any judgement on experienced engineers, but is just a reflection on the kinds of things that make people productive in their domain.

There is a feeling that a team that pair programs more feels more cohesive. I think there is truth to that. The fact that a team talks together more often likely increases their level of comfort with each other, makes them know each other better and provides a lot of opportunities to understand each other socially too. There are other more obvious benefits of pair programming too - observing someone else closely and following their nuanced thinking approach, or seeing the tips or tricks they use while addressing a problem in real time, can be hugely beneficial to your own growth.

However, the question boils down to "How often should you pair program?" I think each team should have this conversation with each other honestly, to find the best balance of ensuring they feel supported, to improve feelings of team cohesion and to ultimately ensure that the unit as a whole feels productive towards the problems they are being asked to solve.