Collaboration doesn't come in "One Size Fits All"
Tags: webdev, node, javascript, productivity
Published: 2019-04-03 00:55:17

---
title: Collaboration doesn't come in "One Size Fits All"
published: true
description: 
tags: webdev, node, javascript, productivity
series: Visual Studio Live Share
cover_image: https://www.digitaldealer.com/wp-content/uploads/2017/12/Screen-Shot-2017-12-05-at-2.16.25-PM-1.png
---

As with many questions in software, the answer to “What’s the best way to collaborate?” is...it depends. Things like situational context, individual preference and team dynamics can differ greatly (and that’s OK!), so it's pretty hard to imagine there being a single "right way" to do it. Collaboration should feel **efficient** and **[enjoyable](https://dev.to/lostintangent/visual-studio-live-share-in-pursuit-of-enjoyable-developer-collaboration-2nko)**, so if your personal experiences aren't reflecting *either* of those qualities, then it might be worth re-considering the tools and/or processes you're using. 

{% twitter 1016398757674577920 %}

When we set out to build [Visual Studio Live Share](https://aka.ms/vsls), one of the most fundamental things we observed, was an interest in collaboration tools that don't *impose* specific interaction models, but rather, allow you to choose the most appropriate, and more importantly, **natural modality** for each task. While screen sharing is great for many circumstances, it isn't ideal for all types of collaborative development, for one reason in particular: participants are inherently **mentally coupled**, and everyone except the host is acting as a **passive observer**, who can't perform even simple actions without having to ask for permission or interrupt the group (e.g. hovering over an API to view it's description).

{% twitter 1207148552465440768 %} 

That experience can feel quite restrictive at times (e.g. prototyping, hack-a-thons), and doesn't necessarily foster the level of engagement you might want within educational settings (e.g. classroom lectures, mentoring sessions). So we pondered: what if we could **de-couple collaboration**, and give each developer their keyboard back, without sacrificing the benefits that screen sharing provides (it's not all bad!)? If we could enable an experience that allowed both synchronized and independent work, for both remote and co-located teams, then maybe, just maybe, we could accomodate the vast landscape of [collaborative use cases](https://aka.ms/vsls-usecases), without requiring anyone to settle. Let me illustrate what this looks like.

{% twitter 1093654624840704000 %}

## Follow the leader

When you join someone’s Live Share session, you initially start out by [“following”](https://docs.microsoft.com/en-us/visualstudio/liveshare/use/vscode#following) them, which has three side-effects:

1. The file they’re actively editing will be automatically opened in your IDE

1. As they scroll within that file, your viewport is automatically scrolled too

1. As they navigate to other files, the target file is automatically opened on your end as well

This behavior allows you to achieve a *shared focus* with the “host”, and maintain that focus as they move around the codebase. We automatically put you in “follow mode” upon joining a session, based on the fact that most collaboration sessions start out the same way: with the host needing to explain the code in question (e.g. describe the bug they’re asking for help with, fill you in on the work they did since the last time you paired). That way, you can simply click a Live Share link, and then immediately gain the context needed to get started. Nice!

![following](https://user-images.githubusercontent.com/116461/55442128-29536d00-5562-11e9-9ec7-83f386559c12.gif)
<figcaption>A Live Share guest (left) following the host (right) as they scroll and navigate files</figcaption>

On its own, “follow mode” is effectively equivalent to a screen share, but with the added benefit of **retaining your personalized environment**, instead of staring at someone else’s. That alone is pretty valuable, but we needed to do better than that, since as I mentioned, we wanted to prevent guests from becoming limited to just “passive observers”. This is where things start to get interesting.

At any time, you can start editing the file the host is in, and as you type, you’ll receive the auto-completion you’d expect. Additionally, you can hover over APIs and/or peek their definition, and once again, receive the language support you’d expect. However, in neither of these cases, does your completion list or peek window appear on the host’s screen. This enables an experience that screen sharing can’t, where you can simultaneously follow along with the host, and contribute independently, **without interrupting each other** in the process. It’s the beginning of true mental concurrency on top of a shared resource (e.g. the file contents).

![Follow+](https://user-images.githubusercontent.com/116461/55443176-9ec13c80-5566-11e9-9788-32b43e492721.gif)
<figcaption>A Live Share guest (left) interacting with a file, without interrupting the host (right)</figcaption>

## Following is so last paragraph

However, what if you need to deviate from what the host is currently focused on? For example, you might want to read some code in another file in order to give yourself more context. Or you could decide to split up a task with your pair, and work on it entirely in parallel. With screen sharing, that wouldn’t be possible, but with Live Share it’s simple: just open another file. As soon as you do that, “follow mode” is automatically disabled, and you can now operate entirely on your own, but still within the context of a shared codebase that’s synchronized in real-time. Sweet!

Once you’re done and ready to re-focus with the host, you can begin following them again by pressing `<CTRL+F>`, or by clicking their name in the Live Share tab. Need to deviate from them again? Great! Just navigate to another file or click their name again to toggle “follow mode” off explicitly.

![BreakFollow](https://user-images.githubusercontent.com/116461/55444964-d2539500-556d-11e9-9ced-61e0e8f76c6a.gif)
<figcaption>A Live Share guest (left) seamlessly transitioning between following on independent navigation</figcaption>

This ability to focus on the same thing, or operate independently, provides the flexibility needed to perform “true” pair programming, collaborate on tasks with your peers, mentor your team, and everything in between. Everyone gets to choose their own interaction style, which may help prevent the “over the shoulder” effect and/or “pairing fatigue” that can come with purely serialized collaboration. But it gets even better.

## Let’s have our code and eat it too

If you right-click a participant’s name in the Live Share tab, and select “Follow to the side”, that will open a new editor tab, and allow you to passively observe them, while simultaneously editing on your own. Even crazier: if there are multiple participants in the Live Share session, you could follow all of them in separate tabs, like it was some kind of real-time collaborative dashboard.

![FollowToTheSide](https://user-images.githubusercontent.com/116461/55445071-632a7080-556e-11e9-82d3-d4b958fe208d.gif)
<figcaption>A Live Share guest (left) following the host while also editing their own file</figcaption>

In addition to the “Follow to the side” gesture, you can also “pin” a specific editor tab to a user, by simply clicking the pin icon in its respective tab well. That way, you can setup a completely custom grid layout, and follow any number of participants in whichever configuration you want. 

## Calling all cursors 

Being able to follow anyone at any time, provides each participant with the ability to choose when and how they’d like to collaborate with each other. However, there are times where you want to actively synchronize everyone’s attention, and it would be pretty annoying if you had to ask everyone to individually follow you. To simplify this case, Live Share also enables you to “focus” participants, which automatically causes them to follow you.

To perform a focus, simply switch to the Live Share tab and click the little megaphone icon in the title bar of the “Session Details” view. By default, when someone else performs a focus, you’re automatically moved to their cursor and notified that it happened. However, you can change that by setting the “liveShare.focusBehavior” to “prompt”, which will give you the choice to ignore focus requests, if for example, you’re in the middle of something, and want to finish it before reconvening.

![Focus](https://user-images.githubusercontent.com/116461/55445257-59553d00-556f-11e9-92f4-54ba043e9afa.gif)
<figcaption>A Live Share guest (left) focusing the attention of the host (right)</figcaption>

## We want to focus...on what matters

Hopefully this illustrates just how accommodating Live Share is, when it comes to deciding how your team would like to collaborate. Unlike tools that have inherent interaction models, Live Share is quite flexible, and allows you to seamlessly transition between actively following, independently exploring, simultaneously editing, and passively observing. We’ve found this to be pretty valuable, and scale well across the diverse landscape of collaborative variations.

{% twitter 1117933123281375232 %}

That said, with great power, comes great complexity, and so we plan to continue improving the discoverability and ergonomics of these features over time. Additionally, we’re keen to hear about other modalities that might be useful, beyond the current feature set. In either case, please don’t hesitate to [reach out](https://GitHub.com/microsoft/Live-Share) and let us know any feedback you may have, and how we could ensure that Live Share appropriately fits the needs of your team.