Why Pair Program
- Why Pair Program
A 1999 study done by Laurie Williams found that pair programming takes roughly 15% more time to accomplish the same task, but produces 15% fewer defects1. We all know that fixing a bug is much more time-consuming and difficult than preventing a bug, so that 15% is not a wash, rather trading time upfront for less bugs is enormously beneficial.
It can be difficult for some people to pair for a variety of reasons (sometimes called "personality types" but that's probably not a good description)
- It's unfamiliar
- They aren't personable
- They have difficulty explaining their thought process
- They aren't patient enough
Other than "it's unfamiliar", these are not good reasons, they are simply reasons. In fact, each of us would be better off if we were more personable, articulate, and patient. And why would a software engineer complain that something is unfamiliar? We thrive on learning new stuff!
Pairing is Tiring
Pairing is more tiring because you work harder. Way harder in my case in fact. The problem is that it is hard to remember that your brain needs a lot of stuff to do its job. In order of importance they are:
- a small break at least once every 45 minutes (every 20 minutes is better)
- water (most headaches are caused by dehydration)
- glucose (eat fat or proteins which are much more effective than raw sugar, but you need to eat them longer in advance)
- a good nights sleep
Most people can sustain hard brain work for at most 6 hours of the day
Improves Code Quality
- We sometimes take extra long breaks because we're feeling stuck or lost. Having a pair can prevent that state.
- A pair can keep you focused on the problem at hand and keep the scope of the story small.
- Working with someone who understands the difficulties of your work, and who can help you avoid some pitfalls, can drastically improve your morale.
Improves the Team
- Improves our personableness, patience, and articulation
- Great way to onboard people, educate juniors, and educate anyone on a part of the codebase that you are particularly familiar with.
- Increases the bus factor by spreading the knowledge.
- Working on the same team helps for cohesion, but working hand-in-hand helps even more.