UPDATE: As of November 18th, Visual Studio Code has gone Beta, and been released as open source. If you want to check out the source, or contribute, you can find the repo at:
https://github.com/Microsoft/vscode
The beta release also adds support for extensions as well as many other new features. The full update list is here.
A day doesn’t go by lately without some new shiny toy being released for software developers to play with. A big challenge is deciding whether the new hotness is something you need to invest time in learning and using, or if it’s OK to let this particular popularity train pass you by. The recent release of the lightweight Visual Studio Code editor is no exception.
In this post, I’m going to help you make that decision, by discussing the advantages and disadvantages of this new tool. I’m coming at this from the perspective of someone for whom the full Visual Studio environment (Visual Studio 2013 Community, and sometimes Ultimate, depending on the project) is my day-to-day development tool of choice, so take that into account as you read.
Is it for Me?
Naturally, the easiest answer to this question is the classic consultant answer: “it depends.”
The key, of course, is what it depends on. And one of the main things it depends on is what platform/OS you call home. If you’re someone who spends most of your time on a Mac or Linux box, and you want to write ASP.NET 5 (formerly known as ASP.NET vNext) or node.js code, you may well want to see what Visual Studio Code has to offer. If you’re primarily a Windows user, and like me, use full Visual Studio regularly, then it may be a little harder to make the case.
It’s also really important to note that VS Code is a preview release at the time I’m writing this. So if you’re not a fan of the bleeding edge, or features that aren’t 100% complete (for example, VS Code supports debugging of node.js apps, but ASP.NET debugging is still in the works), you may want to give this a pass.
Why Visual Studio Code at all?
From the FAQs at the code.visualstudio.com site:
Visual Studio Code provides developers with a new choice of developer tool that combines the simplicity and streamlined experience of a code editor with the best of what developers need for their core code-edit-debug cycle. Visual Studio Code is the first code editor, and first cross-platform development tool – supporting OS X, Linux, and Windows – in the Visual Studio family.
OK, so maybe that’s a little heavy on the marketing-speak, but if I had to pull two critical concepts out of that paragraph, the first would be that VS Code is a lightweight, “streamlined” code editor. It’s not intended to be an IDE like the full Visual Studio on Windows. The second critical concept is that VS Code is cross-platform. So if you are building ASP.NET 5 or Node applications, and you work on non-Windows platforms (or you use both Windows/Mac, Mac/Linux, or any variation of the three), you can have a consistent experience on all the platforms you use. Of course, since VS Code is based on the Atom.io open-source editor from Github (or, more accurately, it’s based on the Electron Shell, which was part of the Atom project), that’s also true of Atom, so if cross-platform is your main concern, that might be another option.
For me, at least, the appeal of VS Code is that it’s lightweight and fast, something that just doesn’t apply to the full Visual Studio. I’m not beating up on Visual Studio, but it is simply not possible to build an IDE as full-featured as Visual Studio and make it as fast as a simple code editor.
Visual Studio Code is part of a workflow style that values editor speed over features. Many of the things that you’d normally expect an IDE to handle are offloaded to task runners and other node packages. For example, VS Code doesn’t have any templates built-in. So if you want to create a new Web API controller, what are you supposed to do? Here’s where a node plugin called Yeoman steps in (I’ll have more on Yeoman in future posts). You can use Yeoman from the command line to scaffold entire ASP.NET 5 sites, or individual files. It’s a very different approach than Add > New > Controller, but one which can be very efficient, as well.
Pros and Cons
There are both good and bad things about this development workflow, so here are a few of the pros and cons of using Visual Studio Code, again from the perspective of an experienced Visual Studio user:
Pros
- Lightweight, and extremely fast to install, compared to a full IDE.
- Native support for Git…open a directory that contains a repo, and go. No complex setup.
- Fast, fast, fast.
- Support for Emmet abbreviations, for super-fast HTML, JavaScript, and CSS coding.
- Super-simple editor zoom. Ctrl+= zooms the code editor and all UI elements. Great for demos.
- Very keyboard-friendly.
Cons
- Debugging features limited, especially compared to a full IDE.
- No out-of-the-box templates.
- No support for older versions of ASP.NET.
- Workflow relies heavily on comfort with the command line.
- Many things missing that a full IDE provides (code profiling tools, object browser, etc.)
This is certainly a cursory list at best, and some of the things I list as cons just aren’t needed in a lightweight editor like VS Code, but I hope that you’ll find them useful in deciding whether to spend time evaluating Visual Studio Code.
But What If I Miss Out?
So maybe, after evaluating Visual Studio Code versus the alternatives, you decide to take a pass. Is that a bad thing? It’s easy in our industry to worry about missing out on the next big trend or tool shift, especially given the pace at which new tools and libraries are released for web development. But the reality is that there’s far too much out there already to know them all. So we have to be selective. And at the end of the day, the only wrong answer is being unwilling to learn anything new. As long as you’re open to exploring new tools, libraries, and workflows, you shouldn’t feel as though you need to try them all. There’s nothing wrong with waiting a bit and seeing which tools thrive and grow, and which fall by the wayside. To paraphrase Calvin Coolidge:
“If you see ten [new code editors] coming down the road, you can be sure that nine will run into the ditch before they reach you.”
Kicking the Tires
For me, Visual Studio Code offers a different approach to development than the one I’ve been accustomed to over the years. As such, it also offers me the opportunity to take a look at new ways of approaching familiar problems. The VS Code approach reminds me in some ways of how things work in JetBrains’ WebStorm, which I’ve also spent some time evaluating recently. WebStorm is more fully-featured than VS Code, and includes an integrated console (one of my favorite things about WebStorm), so it’s very easy to manage and use NPM packages directly from the IDE (full disclosure…JetBrains provided me with a no-cost license for WebStorm related to my membership in an industry group). But unlike Visual Studio Code, WebStorm isn’t free, so you’d expect it to have more to offer.
Bottom line, if you’re a Mac or Linux or cross-platform developer who works on ASP.NET code, or you want to see what the big deal is with code editors other than Visual Studio, it’s worth giving Visual Studio Code a try. It’s still early days, but I like what I see enough to keep working with it, alongside the full Visual Studio flavor.
What About You?
Have you tried Visual Studio Code? What did you like, or what didn’t you like? Let me know in the comments below! Also, if you have feedback you want to share with the Visual Studio Code team, make sure to click the smiley face in the lower right corner of the VS Code editor. It will open a simple panel where you can send a smile or a frown, and optionally provide additional details on why. It’s a nice simple feedback mechanism, in keeping with the simplicity of the editor.
Comments
Comment by Not From Manchester (@mat_mcloughlin) on 2015-07-02 10:43:51 +0000
Visual studio is nice. But I’m going to throw a shameless plug in here for the omnisharp project if you want to be able to write c# code in your favourite editor.
As a side note is also what the VSCode uses for its language services
Good post :+1: 🙂
Comment by G. Andrew on 2015-07-02 11:38:44 +0000
I’ll be sure to have a look at Omnisharp. Thanks for the feedback!
Comment by Thomas Levesque on 2015-07-07 15:22:46 +0000
I think you forgot a major point in the “Pros” section: Roslyn integration. For C# and VB.NET, this gives you code navigation, refactoring (limited for now, but we can probably expect this to be expanded in the near future), instant compilation, etc. I suspect Analyzer packages will also be supported, as in VS2015.
This alone easily makes VSCode one the most powerful code editors (not considering full IDEs).
Comment by G. Andrew on 2015-07-07 15:29:57 +0000
Great point about Roslyn. Not sure I’d characterize it as having forgot, since my intent wasn’t to be comprehensive, but I agree that Roslyn is a big deal, and potentially a game changer.
Thanks for pointing that out!
Comment by Ronan on 2015-08-02 10:13:19 +0000
VSCode is awesome.
I’ve used notepad++, Sublime and Atom on Windows and Mac and VS Code comes out on top in my opinion.
The intellisense is great, the hotkeys are brilliant and the overall look and feel is very pleasant.
Now I come from a VS background so I do have a bias.
Comment by Craig ツ (@MokumaxCraig) on 2015-08-02 22:56:53 +0000
Is there a way to add 3rd party DLLs to vscode?
Comment by G. Andrew on 2015-08-06 18:20:54 +0000
Hi Craig,
I don’t think there’s a way to add DLLs, per se. I assume you’re talking about for ASP.NET 5, in which case dependencies are managed via the project.json file. See here for more info:
http://docs.asp.net/en/latest/conceptual-overview/understanding-aspnet5-apps.html#the-project-json-file
Essentially, in an ASP.NET 5 application, if you were using Visual Studio and adding references, that would add the dependency to the project.json file (and vice-versa). In Visual Studio Code, you simply add the references to the dependencies section of the project.json file (VS Code should give you intellisense on this as a bonus).
In addition to using project.json to add the dependencies, you use NuGet to actually add the packages to your project.
Note that VS Code also supports nodejs development, in which case you’d use the npm package manager to install dependencies, either locally to the project or globally.
Hope that helps!