How to Become a Better Developer #4 — Pair Programming

So far in this series, you've learned strategies of becoming a great developer. But do they all require you to work alone? For example, to keep learning, reading lots of code or keeping up with state-of-the-art seem to be lone-wolf activities.

However, leveling up your programming skill doesn't require you to just sit in front of your computer, you can absorb knowledge from the colleagues around you as well. In this tutorial, you'll learn why pair programming cannot only be beneficial for the resulting code, but also for you specifically as well.

How to Become a Better Developer #1 Series Overview

Partner Up: Pair Programming

Pair programming is a technique where you partner up with a colleague or friend to collaboratively work on a problem in real-time. There are some detailed suggestions on how to split up the roles between the two of you and under what rules to conduct a pair-programming session, but this is not the focus of today's tutorial.

Better Code

We want to focus on what happens when you conduct a pair programming session. When you write code together with a team mate, you've two minds working on the same problem. This tends to result in simpler solutions and fewer bugs; overall, the code quality is higher. Thus, participating in pair programming is a great way of writing cleaner, better solutions.

While writing better code is great, there is a huge benefit for you as well.

Share and Absorb Knowledge

Pair programming brings together two individual developers with different programming experience, knowledge, and preferences. When you work together on a problem, you're bound to stumble onto an implementation idea, you would not have thought on your own. Maybe your colleague even uses a pattern you don't know in detail yet? Either way, this collaborative effort is an excellent way to share knowledge between team mates, and for you a great way to learn while also working.

Unofficial Pair Programming

Your employer doesn't encourage pair programming (because they only see the doubling man hours) and you're stuck on a complex problem? Don't worry, you still can enjoy the benefits of pair programming. Apply an "unofficial" pair programming. It doesn't always have to be a fully fledged pair programming session to enjoy the knowledge sharing. Pick a colleague and outline your solution to a problem and ask for feedback. Or, if you don't know a possible solution yet, come up with one together.

Remote Pair Programming

Another excuse could be that you're a remote developer and physically can't pair program with someone. However, with today's technology, this isn't true anymore. You can simply use screen-sharing and communication apps to virtually walk through a problem together. Try it! Admittedly, it's easier in person, but it definitely still works remotely.

Team Building

Writing better code and learning should already be enough motivators to employ pair programming sessions when you're working on complex problems. But there are more benefits. For example, pair programming brings you closer together with your team mates. It forces you to directly interact with them in intense discussions, which in turn brings you closer to them. You'll learn how to effectively communicate ideas to them. You may learn about their specialty or get to enjoy a particular personal quality you can fall back on, if you need it later.

One last note: don't only see pair programming as a way to get help from others. Make sure you also offer help to newer colleagues. They may have less experience and/or domain knowledge than you and can gain from you. Don't be concerned, this is a great thing, because sharing your knowledge with someone else (= teaching), is a great way to solidify your knowledge. But more on that later.

Summary

In this tutorial, you've learned about the many benefits of pair programming. You've learned to consider teaming up with a team mate when working on complex problems to learn, write better code, and to get closer as a team.

What are your experiences with pair programming? Let us know on Twitter @futurestud_io or leave a comment below.

Enjoy coding & make it rock!


Mentioned Resources

Explore the Library

Find interesting tutorials and solutions for your problems.