Skip to main content

Code with me

This blog post might be outdated!
This blog post was published more than one year ago and might be outdated!
· 7 min read
Holger Dörner
PHP Developer & Chapter Lead

Everybody knows the scenario: You are sitting in front of a programming task but the right solution will not come into mind or a colleague is asking for Your support. Now You sat down and discussed about the Problem and the possible alternative solutions, after all the colleague who could save the day was only a few desks away.

Until the Covid-19 pandemic destroyed this beautiful, intact and sociable office world.

From one day to the next you found yourself in the home office, the laptop on the kitchen table, and the rescue colleagues far away. From then on, meetings only took place online, thanks to Microsoft Teams. The chat with colleagues no longer took place at the coffee machine, but only digitally. Ok, so far, so good one thought, it works after all. However, the first weaknesses of this system quickly became apparent. At the latest when the busy developer stares at the colleague's screen share and shouts sentences into the microphone like "...scroll further stop!...too far!!...back back!!...stop, down a bit again...there yes, there..." or "...line 267...put the cursor in the brackets...not at the end...the third parameter, the type is wrong...THE THIRD, NOT THE SECOND!..." it becomes clear that this type of collaboration is not only not up-to-date, but also nerve-wracking and time-consuming. For everyone involved.

Tooling put to the test

There MUST be a better way! Yes, there is, provided you have the right tool (as always). It just has to be found first, preferably ASAP(TM).

The first official action was to examine our existing tooling, perhaps an adequate solution can already be found here. For example, you could open a draft MR in GitLab and ask someone to look at a certain point in a certain file, who then leaves a comment on it. What is common in code reviews is absolutely unsuitable for this use case. The latency between feedback and implementation is far too high, especially when it goes into a loop. Effective training or mentoring is also not possible in this way. MS Teams does not offer any other satisfactory functionality apart from the screen share already mentioned. It quickly became clear that the only sensible solution was to look for the IDE.

Many code editors and IDEs offer support for "Collaborative Development" or "Remote Pair Programming", either natively or through (third-party) plugins. At bitExpert the vast majority of colleagues use products from JetBrains, such as PHPStorm, WebStorm or IntelliJ. However, the first investigations were sobering: at that time there was no such functionality out-of-the-box, and JetBrains also did not offer such functionality as a plugin. Although such third-party plugins existed, they were usually associated with additional paid licenses. Also, they almost always require the code to be uploaded to a plugin provider's server and/or all communication to be handled through their server. A circumstance that is anything but optimal, since the trustworthiness and data security of the individual providers cannot always be verified beyond doubt.

A short time later, however, JetBrains released the first version of their CodeWithMe plugin, which we immediately subjected to a more detailed test. Of course, this first version was anything but mature, many features were missing or not fully implemented, there were crashes and the latency was often very high. But it was a step in the right direction!

A little leap forward in time, to September 2022. A lot has happened, thanks to user feedback and the work of JetBrains, we can now use a stable tool and draw a first summary.

But first an overview of the most important features.

Key features

The plugin itself is free, with all features. It is available on all platforms supported by the IDEs and can also be used together with their community editions. Virtually all JetBrains IDEs are supported, from IntelliJ IDEA to WebStorm.

Very good integration into the IDE since it is an official plugin from JetBrains.

All connections are routed through the JetBrains servers, end-to-end encrypted, no need to pre-upload the code. To what extent you trust this connection is something everyone is free to decide for themselves. However, there is also the option of on-premises installation, so a server can be hosted in your own network and all connections remain under control. However, a separate fee-based license is required for this.

Only the host needs an installed IDE, all other participants can download a slimmed-down version via the invitation link and start working immediately, this also works under Linux. No license is required for this light version. Anyone who has already installed a full version of the IDE can of course also use this and thus also fall back on the comfort of their individual settings and plugins. The host has very fine-grained options for configuring the rights of the participants, so everything is offered from read-only access to the code to full write access, and access to a terminal can also be configured. The terminal is shared between all participants, so everyone can follow the entries.

All actions take place on the host's computer, all code changes by the participants, all commands in the terminal, and also starting of the application. So be careful here!

All code changes are highlighted in the host's git view according to the participants. This provides an overview but can be very confusing at first.

It is well highlighted where each participant is currently located, for example on the tabs of the open files, and each participant's cursor is also displayed.

In principle, each participant can move freely in the code and open files as they wish. The option of automatically following another participant is very practical and has proven to be very useful in training or mentoring. However, the creation of new files by the participants did not really work and mostly had to be done by the host.

It is possible to start the application via the Run and Debug configurations. This happens in a shared session, which means that the participants e.g. step through the debugger together.

The unit tests can also be started via the IDE. The prerequisite, however, is that the host has also correctly configured this in the IDE.

The host has the possibility to review the changes of the participants at any time via diff previews. He can undo them or commit them straight away.

The plugin supports port forwarding, so it is possible to run the app (or another, even several) on the host and allow participants to access it via their browser. This feature has proven to be very useful, especially when debugging.

In the meantime, the functionality for audio and video chat has also been integrated. Very interesting and certainly very useful for some, but we have little use for it and only tested it once out of curiosity. It certainly seems to serve its purpose well.

Bottom Line

For us, CodeWithMe is an enrichment of our tooling that allows us, especially in the current time when our colleagues are working distributed. It has proven to be valuable support in day-to-day collaboration. But we also use it intensively in training and mentoring. Receiving or giving support in this way is even more efficient than the well-known "look over the shoulder", even if the participants are in the same room. There are still drops in latency here and there, especially with several participants and fast actions, but this is now limited. In terms of functionality, there's nothing that we're really missing. The key features relevant to us work very reliably.

But even if you don't use any JetBrains products, you won't be left out, because most of the big IDEs and editors offer similar solutions. Anyone who uses Visual Studio or VS Code should take a closer look at Live Share. For Eclipse for example, Saros or CodeTogether are available, whereby the latter even promises cross-IDE functionality.

Every environment and workflow is different, from company to company, from person to person, but we can only recommend everyone to test and evaluate such solutions for themselves. In any case, the added value convinced us.