A recent project required our team to transfer knowledge of our code base to another remote team. We decided that remote pairing would be the most effective way to do that.
Here are a few tips to utilize Visual Studio Live Share for pair programming.
(Note: All of the normal rules for pair programming still apply. I also recommend reading Three Keys to Success with Remote Pair Programming.)
Live Share is a great tool for showing changes that you make on the fly. However, it’s not very effective at sharing things outside of the editor. In our experience, screen sharing has proved to be the most effective way to do this. It lets everyone see things like terminal output, or visual updates to a project when you make changes to the code.
Focus on the Driver
Live Share has a feature that allows you to follow the other user’s cursor in your editor. Instead of guessing what file your pair is on through a screen share, you can follow along with each keystroke they make. To do this, click the pin icon in the top right of your editor.
Use Your Mouse as a Pointer
When I’m pairing in person, I often like to point at certain areas of the code. This can be emulated by certain screen sharing tools, but I’ve found that drawing on the other user’s screen can be distracting for the developer. Since Live Share shows you where your pair’s cursor is, I’ve found it to be a good substitute for pointing. You can also highlight blocks of code!
Treat It Like Normal Pairing
Most importantly, you still want to treat Live Share pairing as if you were together in person. This means you should avoid hijacking the “driver’s wheel” as much as possible. If you force the driver to take a backseat while you take control, it takes away one of the benefits of pair programming: knowledge transfer. For this reason, it is best to let the other person have control of the keyboard.
Live Share also makes it tempting to parallelize complex tasks. Doing this takes away another huge benefit of pairing: live code review. If you and your pair are both in separate files implementing a feature, the likelihood that you are going to be checking each other’s work diminishes. For this reason, I recommend focusing on one thing at a time, despite the capability to do otherwise.
For us, remote pairing has proved to be an effective way to transfer knowledge to a remote team, and Visual Studio Live Share has improved that experience.