DEV Community

Cover image for Remote Code Pairing with PHPStorm
James Seconde for Jump24

Posted on

Remote Code Pairing with PHPStorm

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

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 is part of what we do. We can’t all be 10x Engineers 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 for example. One of the other IDEs we use at Jump24 is VSCode (or VSCodium, 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 was released.

So, when trying to debug a particularly tricky set of feature tests with Ben Paddock, 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. Take that, MegaCorp!

Similar approaches: VSCode

It’s worth noting that, because I have some streak of masochism about me, 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

Top comments (1)

Collapse
 
brianfernandes profile image
Brian Fernandes

James, your article hits quite a few of the factors that motivated us to create CodeTogether, and we appreciate the favorable mention, thanks! I just wanted to clarify a few points wrt. CodeTogether's capabilities:

1) Just like Code With Me, CodeTogether does not require the guests to have the codebase locally. The entire project/workspace tree is visible of course (almost immediately after joining a session), and files are fetched as needed. Despite this, guests will still get content assist, validation and code analysis capabilities that the host has locally.

2) We support multiple IDE clients, so you can start a session in IntelliJ and join in VS Code (or vice versa, throw Eclipse into the mix as well) - the guest IDE does not need to be set up for development in the language / framework the host is working on. You can even join from a browser, so if you'd like to participate in a code review session from your phone or tablet, you very well can!

3) Since CodeTogether 4.0 (released in March this year), we've supported terminal sharing with write access. That means guests can type in and execute commands on terminals that are running on the host.

4) We've offered an on premises distribution almost from the very beginning. So you can run your own CodeTogether server for a fraction of the cost of Code With Me's enterprise offering.

Happy to discuss or clarify further - again, thank you for the mention!