Visual Studio Code

While I generally detest Windows and am fairly ambivalent to Microsoft overall, I have to give credit where credit is due: Visual Studio Code is fantastic. I've been using it for the past few months and it's become my new favorite editor. It's very fast and lightweight, but has all the "right" features that I need in an editor/IDE.

The number one feature to me is full Emmet support. I'm hooked on Emmet in general – I won't use any editor/IDE that doesn't support it – and VS Code's implementation is the best I've ever seen. It supports all features of Emmet, not just the basic stuff, and there are some really nice touches: for example, when you use Wrap with Abbreviation, it previews the result as you type, so you can tweak things or correct errors without having to undo/redo multiple times.

The built-in Git support is the other big feature to me – it's basic, but it's done well and will display diffs so you don't have to swap to an external editor.

Finally, I've discovered this color theme called Nord Wave which is just killer :D
 

Jehos

Ars Legatus Legionis
55,560
Yeah, Microsoft's development tools tend to be pretty good best-in-class
FTFY. ;)

I'm one of the weirdos that doesn't particularly like Code, but that's because I work in VS Pro all day. I end up missing the features in Pro when I switch to Code. But having dinked around with Atom and other editors, yeah, Code is a huge step up from them IMO.
 

rabish12

Ars Legatus Legionis
16,983
Yeah, Microsoft's development tools tend to be pretty good best-in-class
FTFY. ;)

I'm one of the weirdos that doesn't particularly like Code, but that's because I work in VS Pro all day. I end up missing the features in Pro when I switch to Code. But having dinked around with Atom and other editors, yeah, Code is a huge step up from them IMO.
I actually really hate VS Pro for web development. It's great for other things, but when I want to build a client it's just not ideal.
 

Jehos

Ars Legatus Legionis
55,560
Yeah, Microsoft's development tools tend to be pretty good best-in-class
FTFY. ;)

I'm one of the weirdos that doesn't particularly like Code, but that's because I work in VS Pro all day. I end up missing the features in Pro when I switch to Code. But having dinked around with Atom and other editors, yeah, Code is a huge step up from them IMO.
I actually really hate VS Pro for web development. It's great for other things, but when I want to build a client it's just not ideal.
Odd, what do you hate about it and what do you use that's better? I've been using VS for web development since InterDev, so my comfort zone in VS is huge. Maybe I'm missing something.
 

rabish12

Ars Legatus Legionis
16,983
Yeah, Microsoft's development tools tend to be pretty good best-in-class
FTFY. ;)

I'm one of the weirdos that doesn't particularly like Code, but that's because I work in VS Pro all day. I end up missing the features in Pro when I switch to Code. But having dinked around with Atom and other editors, yeah, Code is a huge step up from them IMO.
I actually really hate VS Pro for web development. It's great for other things, but when I want to build a client it's just not ideal.
Odd, what do you hate about it and what do you use that's better? I've been using VS for web development since InterDev, so my comfort zone in VS is huge. Maybe I'm missing something.
I'm on an older version of VS Pro (2013) that has poor support in general for JS and HTML. I've tried it on the more recent ones and it's better, but VS is bulky to start up and the added complexity of a full multi-language IDE tends to get in the way rather than helping when I'm working in that space. YMMV I'm sure, but I'm already extremely comfortable with the tools and patterns in that space so having the IDE handle things like builds and such adds almost zero value for me.
 

Jehos

Ars Legatus Legionis
55,560
I'm on an older version of VS Pro (2013) that has poor support in general for JS and HTML. I've tried it on the more recent ones and it's better, but VS is bulky to start up and the added complexity of a full multi-language IDE tends to get in the way rather than helping when I'm working in that space. YMMV I'm sure, but I'm already extremely comfortable with the tools and patterns in that space so having the IDE handle things like builds and such adds almost zero value for me.
Yeah I'll give you that. We just upgraded from VS2012 to VS2017 last week. It's glorious how much better it handles web dev stuff. On the other hand, it's not stuff I realized I was missing before anyway.

What messes with me when I try to use Code is the same thing you're fine with not having--I'm so hard-wired for how VS handles projects, does deployments, etc. that I feel like half my environment is missing when it's stripped down to just a code editor.
 
I think I don't have a problem with VS per se, but I don't like reading msbuild or .sln files. It's an extremely unpleasant and difficult to read configuration language, that simultaneously manages to do too much and not enough.

Also, the one C#.NET project I've worked on, (using VS2013), had a large solution with many projects, and in some circumstances, VS became non-responsive for several seconds at a time, especially with Resharper on, but also occasionally without it.

But, it's a lot better than Xcode!
 

Jehos

Ars Legatus Legionis
55,560
I think I don't have a problem with VS per se, but I don't like reading msbuild or .sln files. It's an extremely unpleasant and difficult to read configuration language, that simultaneously manages to do too much and not enough.
I think Microsoft's answer would be "well don't do that". :)

I can't think of a time I've ever had to manually edit a .sln file, but on the other hand I'm pretty averse to trying to make Visual Studio do things it doesn't want to. That's the road to lots of pain.

Also, the one C#.NET project I've worked on, (using VS2013), had a large solution with many projects, and in some circumstances, VS became non-responsive for several seconds at a time, especially with Resharper on, but also occasionally without it.
That's completely fair. VS is big, full-stop. It helps to have a hoss workstation if you have to work on big projects and use heavy plug-ins like ReSharper.
 

rabish12

Ars Legatus Legionis
16,983
I'm on an older version of VS Pro (2013) that has poor support in general for JS and HTML. I've tried it on the more recent ones and it's better, but VS is bulky to start up and the added complexity of a full multi-language IDE tends to get in the way rather than helping when I'm working in that space. YMMV I'm sure, but I'm already extremely comfortable with the tools and patterns in that space so having the IDE handle things like builds and such adds almost zero value for me.
Yeah I'll give you that. We just upgraded from VS2012 to VS2017 last week. It's glorious how much better it handles web dev stuff. On the other hand, it's not stuff I realized I was missing before anyway.

What messes with me when I try to use Code is the same thing you're fine with not having--I'm so hard-wired for how VS handles projects, does deployments, etc. that I feel like half my environment is missing when it's stripped down to just a code editor.
It's not really that I'm fine with not having it so much as that I specifically don't want to have it. A "project" for JS work is generally just a folder with a package.json in it, and adding and relying on IDE-specific files and folders to manage those mostly just clutters things up while adding no real benefits.
 
I think I don't have a problem with VS per se, but I don't like reading msbuild or .sln files. It's an extremely unpleasant and difficult to read configuration language, that simultaneously manages to do too much and not enough.
I think Microsoft's answer would be "well don't do that". :)

I can't think of a time I've ever had to manually edit a .sln file, but on the other hand I'm pretty averse to trying to make Visual Studio do things it doesn't want to. That's the road to lots of pain.

This doesn't seem like a defense of my criticism so much as a concession that MS's build system is as I described. I need to:

1. Find out what other programmers have told the computer to do.
2. Tell the computer to do what I need it to do.

If MS's build system doesn't make the simple cases of that easy and the hard cases of that possible, then it is, IMO, a bad system. One particular case that I remember is that we had a DSL language in one part of the project. A pre-build step was to run a parser-generator over our syntax definition file, and then hook the generated parser into build step, and then hook the generated parses into another build step that created a bunch of bindings in other languages. That whole system was set up before I arrived on the project, and then the guy who set it up left. At some point, I had to extend the DSL so that it would also generate some more bindings and support some more syntax. Changing the parser-generator to do the new thing took a few days. Fucking with msbuild to shoe-horn that into the build took a lot, lot longer.
 

rabish12

Ars Legatus Legionis
16,983
Yes, msbuild is basically inscrutable. The dotnet.exe API is much nicer. It basically Just Works.
Yeah, it reminds me of the more common tools used for web development. They almost always use fairly simple JSON objects for configuration and they generally have solid default behavior when no configuration is provided. It makes it easy to experiment, easy to get a project started, and easy to work with the configurations when you actually do need to dig into them.
 
I am just delighted by all the extensions it has. Yeah, it's amazing how Microsoft followed up so well with the lightweight editor scene.
Yeah, there's some really great extensions out there. I have one that adds IntelliSense for CSS class names in HTML, based on the actual class names used across all your stylesheets. This is amazing when you're using a framework like Bootstrap, where there's tons of built-in utility classes, variables, etc., but it's tough to remember them all and exactly what their syntax is.
 

drogin

Ars Tribunus Angusticlavius
8,283
Subscriptor++
I really like the Kubernetes plugin, as well as many others.

The VIM emulation is still a bit wonky, and I need to try and contribute some changes if I have the time.

Overall it's a great IDE though. The entire "language server" concept is the right way to go.

A couple of things that maybe you can do that I haven't figured out yet:

1. Would be good to flexibly move around between the editor and terminal with keyboard shortcuts.
2. It doesn't support nested git repos (some call this a feature, it just isn't my reality)
 

drogin

Ars Tribunus Angusticlavius
8,283
Subscriptor++
It's very fast and lightweight, but has all the "right" features that I need in an editor/IDE.
One of the features I need is to render text clearly, taking advantage of my High DPI monitors.

Unfortunately, their bug on this was opened in January 2016 and still hasn't been fixed.

On what OS...I hasn't seen an issue in either Linux or MacOS with font-rendering. Maybe my eyes just aren't that good?
 

hongooi

Ars Tribunus Militum
2,244
Subscriptor
I'm easing myself into VSCode, being primarily a Visual Studio and UltraEdit user. The interface is a bit hipstery for me; I'm missing my toolbars. But it's pretty cool so far, and the extensibility is great.

Re high DPI: I've encountered a rendering bug where a random chunk of the screen gets repainted into an area that should be blank. Someone losing track of their screen buffers maybe? Otherwise it looks great, the text is pin-sharp, no complaints there.

Other random thoughts: VS has really spoilt me for speed. VSC is pretty responsive, and it's better than other editors I've tried (RStudio in particular was shocking), but the input lag on typing is noticeable compared to its big brother. Also, is there a way to use environment variables in config files? The specific use case I have in mind is the C++ extension, where I'd like to pass the location of an include folder as an env var, rather than hardcoding it in the json.
 

Jehos

Ars Legatus Legionis
55,560
Other random thoughts: VS has really spoilt me for speed.
Wait, what? I've never known VS to be anything but a massive resource hog. I get multi-second hangs doing things like cutting and pasting. VS Code has always been way more responsive for me.
Er...wut? That's not normal. VS2017 is significantly faster than VS Code on my work machine. Intellisense, code highlighting and finding references are all much quicker. VS Code feels laggy in those departments, and that's stuff I use practically every minute I'm working.

My work PC is an i7-4790 with 16GB RAM, for reference.
 

hanser

Ars Legatus Legionis
43,847
Subscriptor++
Just after you do an update of VS, SQL Server, SSMS, Windows update, etc. -- anything that uses the CLR extensively -- those applications often feel slow. Flushing the ngen cache helps considerably. Or at least makes the compilation an explicit, top-level task so using those applications doesn't feel like death by a thousand cuts. It made me hate my old 2012 MBP less when working in Windows.

1) Open cmd as admin
2) Run `ngen executeQueuedItems` wherever ngen.exe is. I think it's usually in C:\Windows\Microsoft.NET\Framework\v4.whatever

You should find that VS is considerably more responsive, especially after an update.
 

dodexahedron

Ars Praefectus
3,368
Subscriptor++
I think I don't have a problem with VS per se, but I don't like reading msbuild or .sln files. It's an extremely unpleasant and difficult to read configuration language, that simultaneously manages to do too much and not enough.

Also, the one C#.NET project I've worked on, (using VS2013), had a large solution with many projects, and in some circumstances, VS became non-responsive for several seconds at a time, especially with Resharper on, but also occasionally without it.

But, it's a lot better than Xcode!

MSBuild files are bad, but there's really nothing that compares with the level of hatred that .sln files are.
Literally. They're hatred, embodied in a file format. The only way you could make it worse is like...encoding them in some outlandish scheme where each character itself is represented by a GUID.

HOW HAVE THESE NOT BEEN TURNED INTO XML YET????
That'd make them at least 50% less hateful.
It's like Microsoft wants to make ALMOST your entire development life wonderful - just not that part. Because FUCK YOU. And reasons. Clearly.
 

dodexahedron

Ars Praefectus
3,368
Subscriptor++
Just after you do an update of VS, SQL Server, SSMS, Windows update, etc. -- anything that uses the CLR extensively -- those applications often feel slow. Flushing the ngen cache helps considerably. Or at least makes the compilation an explicit, top-level task so using those applications doesn't feel like death by a thousand cuts. It made me hate my old 2012 MBP less when working in Windows.

1) Open cmd as admin
2) Run `ngen executeQueuedItems` wherever ngen.exe is. I think it's usually in C:\Windows\Microsoft.NET\Framework\v4.whatever

You should find that VS is considerably more responsive, especially after an update.

This is why literally any .net application I deliver has an ngen stage in its installer (obviously fat clients).
Cost the user 10 seconds up front but then make their experience consistent and snappy forever, thereafter? Yes, please.
 

ShuggyCoUk

Ars Legatus Legionis
10,387
Subscriptor++
We now auto generate almost all our sln files. It's fundamentally what msbuild is doing, because it ignores most of the sln file, gets the leaf project you are targeting and compiles/finds the transitory dependencies as it needs - regardless of their inclusion in the sln file.

So long as you can express the leaf projects you care about (normally your exe if you are an app) then you're good.
The fun is including things like test projects in it, which are 'hidden' additional leaves in this model, being explicit about them doesn't solve you much unless you have no tests. Thankfully there are a few solid conventions for how to name and locate test projects so you can auto discover them.

If sln files could just be a list of the leaf projects (and a scheme for indicating the automatic finding of things like tests) life would be simpler. I'm not sure it would be better as xml (it's a crap format for most diff tools sadly) but certainly the format they pick with guids as internal links is miserable) I supect json (with comments allowed) or yaml are both better choices for these files
 

hongooi

Ars Tribunus Militum
2,244
Subscriptor
Is anyone else using VSC with R on Windows? I've run into a couple of problems with R-related extensions.

First, the not-so-serious one. I had a project (folder) where I created a caching directory to store AAD tokens, under c:\users\hongooi\appdata\local\<projectname>. Later, I decided I didn't need that directory after all, and deleted it. But now whenever I open that project, VSC recreates it.

I've opened an issue in the R Tools extension repo here. Is there something in VSC that is making it revive this zombie dir? Where can I find the metadata associated with a project?

The more-serious one: I'm trying to enable the language server support for R, which is provided by the R LSP extension and associated R package. But whenever I open an R file, the language server fails with a bunch of unhelpful error messages.

Code:
[Info  - 8:55:55 PM] Connection to server got closed. Server will restart.
[Info  - 8:55:56 PM] Connection to server got closed. Server will restart.
[Info  - 8:55:57 PM] Connection to server got closed. Server will restart.
[Info  - 8:55:59 PM] Connection to server got closed. Server will restart.
[Error - 8:56:00 PM] Connection to server got closed. Server will not be restarted.

Issue is here, dating back more than a year although the devs thought they'd fixed it back then. Any ideas? Maybe I need to open a port on the Windows firewall or something?
 
I don't theme or customize any of my editors, really. I find deviating from the defaults to increase setup, switching, and collaboration costs, so I try to avoid it. And I recommend other professionals do the the same for those reasons.
That makes no sense. I'm not going to be less comfortable for eight hours a day just so that the 30 seconds you spend looking at my screen is easier for you.
 

KallDrexx

Ars Tribunus Militum
2,040
I don't theme or customize any of my editors, really. I find deviating from the defaults to increase setup, switching, and collaboration costs, so I try to avoid it. And I recommend other professionals do the the same for those reasons.

Every IDE allows exporting settings. So it's 10 seconds to export the settings on dropbox and pull them down the next time you reinstall. The only pitfall I've seen from customizing theme is when plugins get added that do their own coloring mechanics, and trying to figure out what setting you need to change so they don't conflict into an unreadable mess can be painful.
 

hanser

Ars Legatus Legionis
43,847
Subscriptor++
I don't theme or customize any of my editors, really. I find deviating from the defaults to increase setup, switching, and collaboration costs, so I try to avoid it. And I recommend other professionals do the the same for those reasons.
That makes no sense. I'm not going to be less comfortable for eight hours a day just so that the 30 seconds you spend looking at my screen is easier for you.
I'm guessing you don't pair program very often. I also guess you don't spend much time helping your more junior colleagues work through sticky technical stuff. (I just spent an hour at someone else's desk. Thank god his keyboard stuff is the default.) People using their own custom settings is a real productivity drag for me when I'm helping a special snowflake.

I have a Kinesis keyboard. But I also keep a standard keyboard because most people can't type on the Kinesis. Collaboration in that case is 5 second operation. "Here, use this instead."

Every IDE allows exporting settings. So it's 10 seconds to export the settings on dropbox and pull them down the next time you reinstall. The only pitfall I've seen from customizing theme is when plugins get added that do their own coloring mechanics, and trying to figure out what setting you need to change so they don't conflict into an unreadable mess can be painful.
What's a Dropbox? :)

I don't have a problem with *adding* stuff. But changing the defaults to something other than the defaults is irritating.

And I find theming to be a waste of time. For me, the fun stuff is the domain stuff. Writing code, being creative, solving problems. So I pick one of the three VS themes, and that's it. Everything else is, IMO, a waste of time. Theming is what you do when you're procrastinating, frankly. The faster you get up the learning curve(s), the more fun you'll have. ¯\_(ツ)_/¯
 

hongooi

Ars Tribunus Militum
2,244
Subscriptor
Another one: is it possible to change the sidebar panes so that, when I open them, they overlap/cover up the main editor text instead of pushing it to the side?

Here's a couple of screenshots to show what I mean. I have the terminal window containing the R REPL on the right, and the editor on the left. When I open a sidebar pane, it squishes the text in the editor. I'd prefer the behavior to be like the full Visual Studio's docked flyout panes, which popout to cover whatever is underneath.

obkED9K.png


Ta6eu4Z.png
 
I don't theme or customize any of my editors, really. I find deviating from the defaults to increase setup, switching, and collaboration costs, so I try to avoid it. And I recommend other professionals do the the same for those reasons.
That makes no sense. I'm not going to be less comfortable for eight hours a day just so that the 30 seconds you spend looking at my screen is easier for you.
My grandparents lived in the same house for their entire lives and never painted the interior walls, with their reasoning being that if they ever wanted to paint them, it would be easier to do so if the walls were white (which of course is a tautology: if you paint the walls, then they're no longer white, therefore to be easier to paint, you can't paint them in the first place). And so they lived in their house with all-white walls for 63 years just to save themselves the theoretical trouble of having to paint over a color other than white, which they never actually did.

This strikes me as a less extreme version of that :D

That said, I'm really just kidding – your later post explains in much more detail and that makes perfect sense. I'm almost never in that type of situation, so for me it's a no-brainer to customize things exactly how I want them and make my job easier every day, instead of eschewing helpful extensions/etc. just to save myself some setup time if I ever switch editors (which I almost never do).
 
Ignoring for the moment hanser sharpening his hair into a pair of beautiful points, does anyone have suggestions on my questions above?
I know it's an off-topic discussion, but I completely agree with hanser. Customizing stuff has never made me more productive. And this extends beyond IDEs and code editors to things like browser and OS settings. It's only been a net neutral, or made me less productive in the cases that hanser already discussed. Namely, collaboration and wasting time on initial setup when I should be doing something more task-focused.

Has anyone actually ever had their code quality improve and their LOC output increase because their IDE windows are now black instead of white?