React Native

Code better together with Pair-Programming

Introduction

In my experience, pair-programming is above all a training tool.
It's a privileged moment for 2 developers to improve technically, learn from each other, and better communicate.
The ideal pair-programming session is for 2 developers during 1h30.

Checkpoints of a great pair-programming session

  • respect equal development time. For that, many workout apps are great for interval timers: Interval Timer.
  • communicate: ask questions when you don't know or don't understand something, and discuss the technical strategy.
  • challenge the code: all developers have their habits and preferences, pair-programming is the perfect time to challenge them.
    e.g.: use of shortcuts, naming of variables, etc.
  • debrief at the end of the session: through a ROTI.

Common mistakes in pair-programming

  • focusing on efficiency/productivity: a pair-programming session should not allow to deliver code faster but to progress. Thus, you should take time to explain difficult concepts, experiment, compare shortcuts, editor plugins etc.Note: pair-programming will increase your productivity, especially on difficult tasks (debugging, refactoring). However, the focus should be on the learning instead.
  • Taking the keyboard back from the dev who makes a mistake: making mistakes is part of the learning process, its important to make them and understand why it's a mistake.
  • Doing pair-programming too often can be demotivating and tiring. It is a task that requires a lot of communication and concentration from both parties. Once or twice a week is already great!

Remote pair-programming

To do remote pair-programming, it is preferable

  • to be on a video call.
  • to share the screen with a terminal, a browser, etc. Indeed, the pair-programming is not limited to typing code, but also includes all the steps of research of documentation, interpretation of models, versioning management (git flows). These are technical skills in their own right that can be developed during peer-programming.
  • use Live Share.

However, I highly recommend doing pair-programming in person if possible.

In person pair-programming

To do pair-programming in person, it is preferable :

  • to be physically next to each other.
  • on a single computer.
  • on a large screen.

Types of pairs

Experienced Developer and Junior Developer

This is the perfect pair to train a Junior Developer. The goal of the session will be to focus on his progress.

THE JUNIOR DEVELOPER HAS THE KEYBOARD

Role of the Junior Developer:

  • Lead the development: it is by taking the lead on the development that the Junior developer will be able to reveal how they can improve, with coding but also in using their development environment.

Role of the experienced developer:

  • Let the Junior developer make mistakes and then explain: the goal is not to do everything perfectly from the beginning, but to learn from the mistakes not to repeat them. It is therefore essential to create an atmosphere of trust and make the developer understand that making mistakes is perfectly fine.
  • explain the concepts that are not mastered throughout the session: when the developer does not master a key concept, it is better to stop, get on a whiteboard and give a short lesson.

THE EXPERIENCED DEVELOPER HAS THE KEYBOARD

Role of the Junior Developer:

  • Ask as many questions as possible: nothing should remain unclear.

Role of the experienced developer:

  • Ask for what should be done next
  • Explain the decision making process
  • Check that every line of code is crystal clear for the other developer : by asking "Do you understand what this does ?", you can check if everything is clear in the Junior developers mind.

Developers of equal skill

The purpose of a pair-programming session between developers at the same skill level is to learn together on a technical topic : performance, tests, animations, the range of subjects is infinite.

One developer can then code while the other searches for documentation, takes notes on the learnings and think.

  • The key is to maintain a high level of communication during the exercise so that it remains a collaborative moment.
  • Doing pair-programming too often can be demotivating and tiring. It is a task that requires a lot of communication and concentration from both parties. Once or twice a week is already great!

Conclusion

Pair-programming is a great way to transfer the engineering culture from a developer to another, and is one of the most powerful training and collaboration tool that I used during my journey as a developer. These tips come from my experience, but of course the most important is to build your own way of doing it. There is no magic formula, only trial and error !

Similar Ressources

Rejoins nos équipes