Salesforce DevOps: Why Appirio Loves Visual Studio Code

November 19, 2018 Andrew Davis

It’s rare, yet exciting to see a software tool appear suddenly and quickly become the market leader. But in this age of innovation and software-driven disruption, such dramatic shifts should not be so surprising. Visual Studio Code (VS Code) is one such success story: an open-source code editor that first appeared in 2015, and has now become the world’s most popular development environment

Perhaps just as surprising, VS Code is the product of Microsoft, a company whose success and wealth have been built around proprietary commercial tools. Microsoft has not historically been well-loved by the open source community, but VS Code is one of many such contributions made under Satya Nadella’s guidance. VS Code may even be reducing the number of people willing to pay for Microsoft’s commercial code editors. 

But whatever the history, Microsoft has built an editor that has won the hearts and minds of millions of developers. And by making the tool open source, they are benefitting from an amazing stream of innovation from hundreds of citizen developers who have contributed features and bug fixes. Not to mention the thousands of companies, like Salesforce and Appirio, who have built extensions for VS Code.

So, what is VS Code? Why has it become so popular? And why, in particular, is it the new chosen platform for Salesforce to build their IDE on?

What's an Integrated Development Environment (IDE)?

An IDE is a code editor which brings together all the tools that developers need to write, track, debug, test, and deploy code. Some IDEs (like PyCharm) are built for a particular language (like Python), whereas others (like Eclipse and IntelliJ) support multiple languages. An IDE provides a code editor, but also offers things like syntax highlighting, code completion, debugging, and more. Most IDEs are extensible, allowing you to install plugins which add new functionality.

What is Visual Studio Code?

Visual Studio Code is a lightweight but powerful source code editor which runs on your desktop and is available for Windows, macOS, and Linux. It comes with built-in support for JavaScript, TypeScript, and Node.js, and has a rich ecosystem of extensions for other languages (such as C++, C#, Java, Python, PHP, and Go) and runtimes (such as .NET and Unity).
It's a free, open-source, cross-platform, multi-lingual IDE created by Microsoft.
Salesforce has deprecated the IDE, and is solely focused on building tools for VS Code. And Appirio is also building extensions, like our CMC extension, that will make VS Code increasingly powerful over time. Both Salesforce and Appirio are building our tools in a flexible, open-source way so they can be adapted to other IDEs. But we're using Visual Studio Code as our reference app, so we can quickly build features to support our teams.

Why Visual Studio Code?

Visual Studio Code is fast and can be installed on Windows, Mac, or Linux machines.

  • It has support/extensions for 72+ programming languages, out-of-the-box.
  • It gives built-in syntax highlighting and bracket matching in your code, as well as easy code navigation.
  • It has a built-in terminal and a stepwise debugger that supports many languages.
  • It supports Git natively, so you can view diffs, commit, sync, and perform all the essential source control commands — all without leaving the editor.
  • It has a wise set of defaults but is extensively configurable.

There are many other blogs (like this one and this one) that have done ‘bake offs’, or detailed feature comparisons between other popular editors (like Vim, Eclipse, Sublime Text, Atom, and TextMate). We won’t repeat all of the details here, but can summarize some of the main comparisons:

  • It’s more user-friendly than old-school editors, like Vim, Emacs, Nano, Pico, etc. (anyone remember Edlin?)
  • It’s faster and more flexible than Eclipse.
  • It has a full set of developer tools, like version control and debugging, unlike Sublime Text or Atom.
  • It’s also faster and better on large files than Atom.
  • It has far richer capabilities (like syntax highlighting and auto-formatting) compared to TextMate, BBedit, or Notepad. It’s free! Unlike IntelliJ or (the original, commercial) Visual Studio.

Why did Salesforce choose VS Code as their new IDE?

While Salesforce itself lives “in the cloud”, professional developers tend to write code for Salesforce using desktop tools. For a long time, the IDE, based on Eclipse, was the standard Salesforce development environment. With the preview release of Salesforce DX in 2016, Salesforce also launched the IDE 2.0, also based on Eclipse. But before long, they changed course and are now exclusively promoting VS Code as their official editor

Why the change of heart?

There are numerous factors, but one of them is the architecture that VS Code is built on. VS Code is built using Electron, a framework that allows you to build Windows, Mac, and Linux desktop applications using HTML, CSS, and JavaScript. This means that to improve the user interface or add automation to VS Code, you can use the same technologies used to build websites — the most common IT skill set in the world. VS Code also uses the innovative concept of Language Servers — which allowed Salesforce to build a generic language server for Apex and Lightning, that could later be ported to Atom, Eclipse, or any other IDE that supports Language Server Protocol (LSP). 

In the meantime, Salesforce was aware that MavensMate (especially in conjunction with Sublime Text) had become the open-source editor of choice for many Salesforce developers who preferred it’s speed and simplicity to the older, rigid, structure enforced by Eclipse. Sublime Text’s simplicity was a key inspiration for VS Code’s clean UI.

So by Dreamforce 2017, Salesforce had officially retired the IDE (including the newer IDE 2.0), in favor of VS Code. Appirio too began promoting VS Code as our editor of choice beginning earlier in 2017.

In the meantime, Salesforce has continued to roll out innovation on top of VS code, and the VS Code team themselves have been releasing new features at a phenomenal pace.
Give it a try!

In short, check out Visual Studio Code. If you’re accustomed to working in simple text editors like Sublime Text, Atom, or Notepad++, you should check out the powerful debugger, and version control integration. If you’re accustomed to working in Eclipse or IntelliJ CE, you should check out the speed and rich extension library. And if you’re currently paying for a commercial IDE, you’ll be happy to have this free alternative!

Across Appirio, teams using a variety of languages and platforms have enjoyed moving to VS Code. Choice of IDE is still a personal preference, but there are great benefits to teams adopting a common tool. VS Code makes it possible for Appirio to build tools used across all our teams, and makes it possible for developers to help each other out and share tips. 

We look forward to continuing the collaboration that VS Code allows. Get in touch with us if you want help improving your team’s development experience.

Previous Article
How To Write a Coherent and Efficient SQL Test Script as a DATA QA
How To Write a Coherent and Efficient SQL Test Script as a DATA QA

When we start developing our (Quality Assurance) QA script, do we really consider whether the script will p...

Next Article
Product Service Systems: Getting Started
Product Service Systems: Getting Started

Product Service Systems (PSSs) are business models that integrate products and services to extend the value...