Remote Code Pairing with PHPStorm
Tags: php, productivity
Published: 2021-05-07 09:25:27



Among the many challenges developers face when working 100% remote are those times when you face a problem that results in you staring at your IDE blankly for minutes on end.

The ability to swivel your chair around and quickly throw out “have you got 2 minutes to rubber duck this bit of code please?” has become a distant memory.

![Loads of rubber ducks in a factory](https://jump24.co.uk/uploads/2021/02/ducks-1024x683.png)

Pair programming is a practice that I have encountered far less than I feel is acceptable within agency software development. As always, everything evolves around time; from what I have experienced across this sector, if it’s not coding that feature and getting it out the door as quickly as possible, it’s not worth the company’s time.

Of course, at Jump24 we don’t operate like that, because investing time in [our tooling](https://jump24.co.uk/journal/tools-of-our-trade/) is part of what we do. We can’t all be [10x Engineers](https://twitter.com/skirani/status/1149302828420067328) and so, with the company completely remote, how do we solve the rubber duck problem?

Remote pair programming tools have been around for some time – Saros, which is available for IntelliJ and Eclipse, has [been in development since 2006](https://github.com/saros-project/saros/releases/tag/v0.8) for example. One of the other IDEs we use at Jump24 is VSCode (or [VSCodium](https://vscodium.com/), which is VSCode with Microsoft’s telemetrics reporting taken out) has several extensions available that also do remote sessions – CodeTogether is a solid choice in my experience.

Like many organisations, 2020’s COVID crisis has propelled some of these tools to the forefront of developers’ consciousness – and it seems Jetbrains responded by accelerating development on it’s remote pairing plugin. While it’s already been mentioned that VSCode has remote pairing extensions available, the same features were astonishingly requested in Jetbrains’ Issue Tracker as long ago as 2004. Spearheaded presumably by COVID demands from remote workers, finally on 2020-09-18 [Code With Me](https://blog.jetbrains.com/blog/2020/09/28/code-with-me-eap/) was released.

So, when trying to debug a particularly tricky set of [feature tests](https://jump24.co.uk/our-work/) with [Ben Paddock](https://twitter.com/_pads), it seemed like the perfect time for us to experiment with it.

## Setup Before

What would the next steps have previously been before Code With Me, then? Well, choose your video conferencing suite of choice, share screen and one of you drives the session. It’s not the most intuitive of solutions, but it does at least mean your partner can see and dictate potential changes with you over video.

## Problems

The biggest blocker for this type of pairing is that the ‘client’ human has no control over the IDE. Indeed, this is true of real life: when trying to think of potential solutions in code, one of you can only dictate to the other who is driving. I’m sure many readers would agree that, sometimes, dictating code and code changes is hard.

## Features

Code With Me has a couple of advantages over similar plugins such as CodeTogether. Here’s the two key features at Jump24 we found that were essential:

* Because it uses a remote Java client developed by Jetbrains, it sandboxes the whole IDE on the host to the client. This means that the client doesn’t need to have the codebase. In our development where individual developers work on large, split codebases with entire Docker stacks, this gives a massive boost by not necessarily needing the entire project downloaded, dependencies from Javascript and PHP run and docker-compose spun up.

* Because this client replaces the functionality of what ssh would be doing if you were to remote pair in something like, for example, vim and tmux, it means you both have 100% keypress access to the same remote terminal. If you were both debugging on a remote server, sure this doesn’t seem special. But, couple this with our large Docker stacks and both of you can run a command line ssh’d within the Docker stack on the host machine.

## Aha! But Security!

So, in terms of security and given that you can share an entire codebase with another “dumb IDE”, what’s going with those comms under the hood?

The answer is: they’re going through Jetbrains’ servers. The infosec managers cry “ISO27001!” and if you’re in a large MegaCorp your pairing dreams are over. But, one of the really lovely features rolled out with this plugin is you can [run your own Code With Me server](https://www.jetbrains.com/help/cwm/code-with-me-quick-setup.html). Take that, MegaCorp!

## Similar approaches: VSCode

It’s worth noting that, [because I have some streak of masochism about me](https://xkcd.com/378/), I actually use two IDEs: PhpStorm for backend development in PHP and React/Vue and VSCodium for node.js and vanilla JS.

CodeTogether has been available for VSCode for quite some time now, and while you might be tempted to scoff that users of that IDE have been ahead of the game, the two key features noted (remote shared terminal, run your own server) make Code With Me just take the edge. I expect these features to likely be on the way, mind.

## Conclusion: more joyful pairing

Zoom calls and Skype screen sharing in the time of COVID have become tiresome, but switching to this toolset makes remote pairing a world of difference for the better. There’s just too many upsides to ignore here – as well as key features mentioned, it’s just the little things when trying to untangle your spaghetti. When you’ve both got the IDE running rather than one transmitted across via screen share, your linter works, both of you can use code completion and can navigate through classes – the list goes on.

And, more to the point: surely anything is better than trying to dictate to the user what code to write.

![A Turtle on a keyboard, because finding images is hard](https://jump24.co.uk/uploads/2021/02/joyfulpairing-768x432.png)