Pair programming is coding with someone else. Usually one person codes while the other offers insights and suggestions.
Some companies require their coders to always pair up (known es extreme pair programming), but, in my opinion, that’s not the right way to do it. Everything in moderation, right?
As a full-time coder, pair programming more than an hour would be too much. One hour would be fine, and probably only a couple times a week.
For me, pair programming is one of the most enjoyable aspects of coding, and it comes with a lot of benefits. Here are the eight great benefits of pair programming.
1. Learn from others.
It might seem like an awkward thing to do, coding while someone else observes, but you’d be surprised how nice it is to have someone there that you can ask questions. The observer can also let you know if you’re doing something the wrong way, or he can validate that you’re doing it the right way.
2. Teach others
On the flip side, if you’re the observer, you can give the coder tips and tricks.
3. Balance
Everyone has his own preferences. Some people like to write the most succinct code possible in the form of one-liners with each one-liner having five or more things going on. Sure, it’s great to be able to do so much with so little code, but when you run into these one-liners, it can take a while to figure out everything that’s going on. So many things happening is such a short piece of code.
I’m the opposite. I’m very verbose because I love making code readable. If I do some pair coding with someone who loves one-liners, I can remind him to make his code a little more verbose, and he can remind me to make my code a little more succinct. Hopefully, in the end, we’ll end up with succinct, readable code.
4. Accountability/Motivation
I’ve rescued my productivity many times by setting up a pair coding session with a teammate. What’s he going to think if I have nothing to tell him about the task I’m working on?
Pair programming also helps you stay accountable. You’re more likely to finish part of a project by a certain time if you are going to work on it with someone.
5. Misery loves company
Pair coding makes even the toughest bugs less miserable to fix.
6. Get unstuck
There are lots of reasons you might get stuck when coding.
A project might be overwhelming, and you might not know where to start. Getting another pair of eyes on a project can really help you put it into perspective.
Another reason might be too many roadblocks. You can usually get through one roadblock on your own, but running into multiple roadblocks can really kill your productivity. If you set up a time to pair code, you can offload some roadblocks by getting help from your partner.
7. Variety
Just like many things in life, it’s possible to code by yourself 100%. of the time, but even as an introvert, coding by myself can get pretty dry. Pair programming helps to break up the monotony of working by yourself.
8. Camaraderie
Usually when you pair program, it’s just you and one other person. This is the best time to bring up issues you wouldn’t bring up in a group.
If you’re feeling over-worked (or possibly under-worked), pair programming is a great time to bring it up.
Two heads are also better than one. When pair coding, your strengths can offset someone’s weaknesses and vice versa,
Once you’ve tried pair programming, you will definitely appreciate it.
One of the reasons I created this website is to give people the opportunity to pair program with each other. Join the Pair Code Pro membership to do some pair coding with me and other members. Whether you have a job or not, pair programming is a a great way to advance your coding career.
tl;dr Benefits of Pair Programming
- Learn from others.
- Teach others.
- Balance
- Be account-bled motivation
- Misery loves company (bugs)
- Get unstuck
- Variety
- Camaraderie