Special Rules of Pair Programming
Tech leaders in my company are big believers in pair programming. Ever since I relocated to my current place, I rarely skipped working on a task without pairing. I had been pairing with 4 people for one and half months, with different personalities. There are some nice learnings that I can think of to make a pairing session goes smoothly & ends with success.
Argue and accept
The main idea of pair programming is to reduce the amount of bad smell and buggy codes as soon as possible. It takes a proverb “Two heads are better than one” in terms of solving problem. This also means that you should share your thoughts during the coding session, and argue whenever you have a different way to see the problem. Arguing is easy, the difficult part is to accept your opponent’s argument. So, make sure that you should agree to one decision at last.
Share similar ups and downs
I had a pair that have a very different timeframe of working with me. We came and leave on different time everyday. When we were pairing, we shared different behaviour. For example, He’s a smoker, I am not. Hence, I never had an urgency to smoke for every 1 or 2 hours. But since He had, I had no choice. This caused the speed of development was really slow. Then what will happen is you start to realise this slowness, so you start working on the task without pairing (when your pair already leaves the office). The worst thing that could possibly happen is in the next day when you come to the office, your pair will see some new codes and I can guarantee some unnecessary debates happening here. So, if both people should share similar ups and downs, it will save you from some pain in the ass.
Use common tools
This is a common issue during pair programming. A general case is when A usually uses sublime (or other common text editors/IDEs with simple-popular keymaps & shortcuts) and B uses vim on terminal. Then ideally, you should use A’s machine to work on your task. Pair programming requires swapping keyboard every some time. If your pair is not comfortable with your tool, you should yield (in positive way). Don’t push your pair to use fancy/complicated tools unless he/she agrees.
Ego will kill you
All points above are about controlling your ego. Whenever your ego controls your mind, you will start to hate all differences between you and your pair. That means, you will hate most of your time at work. Whenever you are unhappy at work, you’ll stop being productive. I don’t have any advice on this, but you just need to avoid ego controlling yourself during a pairing session.