On Switching to Visual Studio Code

programming Dec 10, 2016

I've been using SublimeText for years, and when I was using it exclusively as an editor it was great. I could install the minimum set of packages like Flatland and SublimeGit and have a good fast editor that could sometimes do more.

Problems came when I started working on a large Python 2.7 application, and needed to get up to speed with the framework, the language, and the project conventions fast. Of course I wanted to use SublimeText, but I needed a little bit more in the way of code hinting and linting, and so I turned to PyCharm from IDEA. I was familiar with a lot of the the other IDEA IDEs like IntelliJ and WebStorm from Scala and Node.js projects, respectively, but I also didn't want a bulky IDE killing my performance. I began to research Python focused plugins for SublimeText, and there seemed to be some good toolchains for getting all the code hinting and linting I needed, like SublimeJEDI and Sublime Linter paired with the python linter of your choice (we used pylint and flake8 to cover the bases). I was able to successfully make SublimeText my Python IDE.

Eventually, I started to feel like, "Well, I also work with Javascript and Coffeescript, and Elixir, and some of these config files are complicated without parsing." I added more plugins to handle parsing and linting for some of the other languages I was using, and after a couple of months I began noticing my battery was lasting about 3 hours, and my laptop was getting absurdly hot to the touch. I would even notice significant lag in Sublime Text when I would enter text. I disabled and renabled plugins to try to find the cuprit and if I found something that was causiong more problems than it was solving, I would uninstall it. This was apparently a common occurance in the SublimeText community and so it was nothing new, and it was still better than PyCharm.

Meanwhile, I began checking out this YouTube series called Handmade Hero, the goal of which is to build an entire game engine in C/C++ from scratch with no libraries and minimal tools. The creator of the series, Casey Muratori, found a way to integrate the Windows command line builder cl.exe into Emacs by way of a batch file, and I wanted to see if I could do it in my editor of choice using SublimeText's build system. I found some extension to simplify the build configuration and allow for parsing of compiler output, but I found myself wrestling with SublimeText's weird version of regex to do it. This worked for me and I felt clever for figuring it out, but the plugin situation still rankled me.

Periodically I would try a new editor in the hopes that it would run better and have a better plugin ecosystem than SublimeText, but Atom never quite got there for performance, and intially Visual Studio Code didn't have a rich enough set of plugins even though the plugins it did have were of very good quality.

Eventually, I read that Microsoft released C++ support for Visual Studio Code and decided to see if I could migrate the Handmade Hero project. It took about an hour to get the build working, and I also found that out of the box I had code completion and some light static analysis. Excitedly, I began moving other projects over to Visual Studio Code, and found that even with these language support plugins there was no noticable dip in performance in VSCode. About a year and some change in, I've only noticed some battery drain, but about the same as Chrome or iTerm, which I use all the time as well. I haven't gone back to SublimeText since then.