Chefs have their favorite knives, barbers have their favorite pairs of shears, and coders (as well as most people working with technology, including many linguists) have their favorite text/code editor.
Since they are one of the primary tools for coders, sysadmins, and everyone else working with plain text files, there always has been a healthy (well, …) debate about which editor(s) to use. For many, their editor, and especially their personalizations and customizations, is part of their personality - it’s a bit strange.
Anyway! Every year, Stack Overflow is doing a large Developer Survey in which software developers are asked about who they are and what their preferences are. One of the questions is targeted towards which editor (and development environment) is preferred by them. If we look at the last couple of years, there is an interesting development: While the category was firmly dominated by Sublime Text, Notepad++, and Visual Studio, since 2018 Visual Studio Code - VS Code, released in 2015 - has firmly taken the lead. In the most recent survey (2019), more than 50% of developers named VS Code as their preferred development environment.
I tried it back when it was released and quickly decided that I really did not like it at all. Now, I am jumping aboard the train!
A Personal History of Editors and IDEs
Traditionally, there is a pretty clear distinction between a text or code editor and an IDE (Integrated Development Environment). While the former is there to edit text files efficiently, the latter provides additional features (e.g., syntax highlighting or debugging) useful to programmers.
My earliest attempts at coding happened in Borland’s (now Embarcadero) Borland’s (now Embarcadero) Delphi 7. Delphi (basically Object Pascal), which I still admire for lots of its features and concepts, essentially is a convenient programming language and a powerful IDE that is (mostly was) very well suited for GUI development. Nowadays, at least in my opinion, there are not really any good reasons to start a new project in Delphi, but the IDE is still pretty impressive! Well, that’s another story!
Aside from the coding, I also need a good editor for sysadmin tasks as well as for corpus linguistics. Yes, (corpus/computational) linguists spend a whole lot of time editing texts. The point is that I spend a lot of time with my editor and that it is a crucial part of my workflow.
For the last couple of years, I was (and still am) in love with Sublime Text. It is a great editor, and with the right extensions, it provides many features of a good IDE. Additionally, I also often (have to) use VIM (and Nano if no-one is looking) because I have to work with files over SSH quite often. I have recommended Sublime to many students and colleagues (do not worry, you can keep using it!), and I truly enjoyed working with it!
Recently, I found the time to listen to some older episodes of Talk Python To Me and particularly the “Digging into Visual Studio Code” episode with Dan Taylor. After listening to the show, even after having tried and rejected it before, I decided to give VS Code another go. Well, it was love at first sight, and within one or two hours, I decided to end the relationship with Sublime - we are going to stay friends, however!
Five Reasons for VS Code
After this rather long prologue, I want to give my five top reasons for switching to the new editor.
1. The Perfect Balance Between an Editor and an IDE
As I described above, I have a thing for good, extensive IDEs. At the same time, I really do love the simplicity and the speed of a simple text editor. Microsoft has managed to find, at least for me, the perfect balance between these two worlds. I love that VS Code, for example, has a very solid debugger, great Git(Hub) support, great code completion, a very nice terminal, and smooth linting. It feels like working in an IDE, but without all of the overhead!
2. Amazing Python and Anaconda Support
Python, at least currently, is my main programming language. VS Code won me over for two main reasons: First of all, there is a brilliant Python extension by Microsoft, which turns the editor into a truly powerful Python development environment. Secondly, there is great support for Anaconda and Python environments in general. Having the option of swiftly switching between environments is not just a time-saver, but also proactively saves me from making bad decisions on a daily basis.
3. Great Support for Large Files
As a corpus/computational linguist, I often have to work with rather large text files. Out of all the editors I have tested, VS Code has the best overall performance when it comes to these kinds of files.
Below you can see how long it takes Sublime and VS Code to load a 138 MB text file. After loading the file, 500 lines are appended to test how the editors handle file changes. Well, one is about four times faster than the other!
As you can see, VS Code detects that the file is very large and, by default, disables a number of features. It is exactly these tiny, but very important, details which I truly enjoy!
4. Remote Capabilities (SSH, Docker, WSL)
One of the single most useful and impressive features of the editor is its remote capability, which can be added using official extensions. Using these extensions, you can, for example, edit files on a remote host via SSH. The editor will, in that particular case, install a tiny server on the remote machine and then act as a frontend on your local machine. This gives you desktop class file management and editing, but on a remote machine. This has been a game-changer for me! Not having to switch between my ‘regular’ tools and VIM/Nano as often is just magnificent!
In addition, there are remote extensions for doing the same thing with Docker containers as well as with the Windows Subsystem for Linux (WSL).
5. Usability and Extensions
As I said, I love Sublime Text, and over time, with the help of many great extensions, I managed to customize it to a point where it did just what I wanted. That being said, ‘my’ Sublime always felt a little improvised. It is fairly hard to describe, but it did not feel as if it was one coherent thing, but rather a charming but somewhat broken collection of plugins. I am absolutely certain that there are people out there who have brilliant Sublime setups, but I never really managed to get if perfect!
At the same time, VS Code and its extensions gave me a great feeling from the start. The interface is amazing, and all of the extensions I have tried so far feel extremely native and well-embedded. Put simply, it is a joy to use, and I truly enjoy working with it! In addition to that, it regularly provides hints towards extensions which could be helpful in a given context (e.g. a new filetype).
To be honest, I am not really sure why I have written this post in the first place. There are hundreds of people who made the change (as one can see in the survey), and there are even more people who wrote about it.
Nevertheless, I wanted to share my experience and especially how such a simple thing as a new text/code editor really has changed my workflow for the better and gives me joy - it sounds very strange - every day. The fact that Microsoft (!) decided to open source the whole thing and make it available on all platforms is just the cherry on top!