Remote Pairing with Portal

Eric Tsiliacos
3 min readJan 28, 2021
Photo by Proxyclick Visitor Management System on Unsplash

Remote Pair Programming

One of the joys of experiencing extreme programming is the high bandwidth communication that pairing enables. But remote pairing can be challenging in a world where the bottleneck to our communication is quite literally our internet bandwidth. Products like Zoom and Tuple or even tools like tmux can help but nothing beats sharing an interaction with someone from your local machine.

In pair programming, there’s a classic pairing maneuver called “ping-pong-pairing”. It’s when one person writes a failing test, and the other person writes the simplest code to make it pass, then writes the next failing test, switching back and forth. When done in person, it can be a playful technique to keep each person equally engaged. Remotely, it can feel unnatural and arduous.

I began to miss the magic of pairing.

What if there was a quick and easy way of moving code between machines to enable switching between pairs, while also allowing the one driving to work from their own machine?

Portal

Introducing Portal, a git backed convenience command line application that uses git-duet or git-together to easily swap code between you and your pair’s machines.

The pair begins their day by both setting their git commit authors using git-duet or git-together on their respective machines.

> git duet pa ir

Then for the rest of the day, the pair uses portal to move code between their machines. Using either Zoom or Tuple to screen share, one member of the pair writes the failing test, then runs the following from within the root directory of their git project.

> portal push

When the command finishes, the other person can run the following command to retrieve the code in order to make the failing test pass.

> portal pull

The pusher will find their git workspace clean and the puller with the code as they saw it on their pair’s machine. That’s it — ping-pong away!

Magic

Trunk-Based-Development

Aside from the ease at which code can be moved between the pair’s machines, portal facilities trunk-based-development. One might be tempted to manually create a temporary branch or even a feature branch off of the main branch, and use git push/pull between the pairs but this has two disadvantages.

  1. Coming up with commit messages just to move code between machines can feel unnatural.
  2. The pair is more likely to create a long lived branch instead of making smaller commits against main.

Portal lets pairs switch at arbitrary points in time while staying on the main branch. Coupled with techniques like commit-message-driven-development and test-driven-development, portal puts the magic back into pairing, remotely. Give it a try and let me know what you think!

--

--