r/javascript • u/ebenjamingb • Feb 02 '21
Visual Studio Code: How Microsoft's 'any OS, any programming language, any software' plan is paying off | ZDNet
https://www.zdnet.com/article/visual-studio-code-how-microsofts-any-os-any-programming-language-any-software-plan-is-paying-off/18
50
u/grantrules Feb 02 '21
VS Code + WSL2 + Docker engine + remote container extension = sex. I've been developing for 25 years and this is the best environment I've ever had.
13
u/kagelos Feb 02 '21
Why do you need both WSL and docker for development?
11
u/grantrules Feb 02 '21
You could do it without WSL. I like the Linux CLI, bash scripting, apt, init scripts, stuff like that, but I like the Windows 10 UI.
1
u/CalgaryAnswers Feb 13 '21
The person asking you the question has obviously never seriously worked with docker on windows machines
0
Feb 03 '21
[deleted]
5
u/grantrules Feb 03 '21 edited Feb 03 '21
Because in WSL I run screen, irssi, have all my ssh keys for servers I have access to, a ton of shell scripts for repetitive tasks I take care of.. not just stuff specific to a project I'm working on, so why muck up my dev environment with random unrelated crap? Plus I don't have to worry about stupid windows shit like file permissions and pathnames and shit, since all my projects live within WSL.
Is there something wrong with running docker within WSL2?
MS has a nice article on how to do it: https://docs.microsoft.com/en-us/windows/wsl/tutorials/wsl-containers
0
Feb 03 '21
[deleted]
2
u/grantrules Feb 03 '21
Yeah I was using Windows Insider which had it before version 2004, I think, pretty sure I was using it on my work laptop before Covid layoffs.
4
u/MrPker5 Feb 02 '21
Im trying to setup a similar environment but can't get my head around it.
Things i have tried right now (this in on the company's laptop), Docker desktop with wsl2 with ubuntu installed via the windows store. For some reason it isn't fast.
I also feel like my the setup could be better Git wise. Since i tried cloning this boilerplate for laravel https://github.com/aschmelyun/docker-compose-laravel and i don't really feel like having the source code in a seperate src folder. My goal is to have the laravel source without the bloat of the docker container so that the Git is just Laravel code. (it needs to be pushed to something like Laravel Forge)
How i would like to see it is like this. A docker container where i can link a website too so that there is always one container and i can switch easily between websites dev environments.
Could you give a short summary of how your workflow is right now?
2
u/grantrules Feb 02 '21 edited Feb 02 '21
I don't know anything about containerizing laravel. I run docker engine in wsl2 and don't fuck with docker desktop. Most of my development is SSR React apps. I don't know how you'd be able to avoid having config files for your containers in your repo if you want an environment you can replicate, don't really see why it matters though
2
u/tquinn35 Feb 02 '21
There are a lot of performance gotchas with docker and wsl2. If you mount to the windows file system instead of the Linux file system for instance you will get pretty poor performance. This is true for most things in wsl2. Everything will be fast if it’s in the Linux file system instead of the windows file system. The one downside is you then can’t open stuff using windows such as excel sheets using excel.
1
u/slykethephoxenix Feb 02 '21
\\wsl$\{{DISTRO_NAME}}\home\{{DISTRO_USERNAME}}\or//wsl$/{{DISTRO_NAME}}/home/{{DISTRO_USERNAME}}/doesn't work or you?1
u/tquinn35 Feb 03 '21
Are you asking me if I can access the home directory?
1
u/slykethephoxenix Feb 03 '21
The one downside is you then can’t open stuff using windows such as excel sheets using excel.
You should be able to open anything. Unless you mean launching Excel from within Ubuntu, in which case, my bad I misunderstood!
1
u/tquinn35 Feb 02 '21
There are a lot of performance gotchas with docker and wsl2. If you mount to the windows file system instead of the Linux file system for instance you will get pretty poor performance. This is true for most things in wsl2. Everything will be fast if it’s in the Linux file system instead of the windows file system. The one downside is you then can’t open stuff using windows such as excel sheets using excel.
2
u/kyeotic Feb 03 '21
I've had nothing but endless problems with WSL 1&2. File permission issues, linux incompatibilities, random failures. It's just one stupid problem after another.
WSL is a broken, frustrating mess.
1
u/grantrules Feb 03 '21
WSL1 had some issues for me but WSL2 has been fine.
1
u/kyeotic Feb 03 '21
I still get constant file permission issues from Linuxbrew/npm/apt-get on WSL2.
I’ve never gone a full day without one, and I’ve been giving up on trying faster and faster.
1
u/grantrules Feb 03 '21
On the Linux virtual disk or the windows fs?
1
u/kyeotic Feb 03 '21
Both. apt-get and linuxbrew should be all on the virtual disk, npm will be on either depending on what its doing.
1
u/Infiniteh Feb 12 '21
I'm curious: if you use WSL you must like using Linux for some reasons. Why are you then still on windows if WSL is giving you so much trouble? No hate, genuinely curious.
1
u/kyeotic Feb 12 '21
My most powerful computer is my gaming computer. Likewise, it’s the most comfortable setup. I would like to be able to use it for software dev since it’s the machine I’m at most of the time. I keep trying WSL in hope that someday it’s usable without bugs.
I’m on windows because it’s where games work with the least friction.
When I get frustrated I switch to a Mac, where shit works. The hassle is switching the inputs and the monitor, I haven’t found a kvm that I like.
1
u/Infiniteh Feb 12 '21
You can try dual booting linux. Switching from one OS to another takes less than minute if you're on a gaming capable machine. There's tons of tutorials on dual booting ubuntu with windows.
1
u/kyeotic Feb 13 '21
I have dual boot setup. I use it occasionally. It's a hassle to lose my windows state though, I always have a million things running, so I usually just grab my macbook.
That's kind of beside the point though. I have windows running. It would be nice if it was capable of software development outside of dotnet. WSL was supposed to provide that solution, but imo it failed.
1
u/qudat Feb 02 '21
All my side projects are built with this setup and haven’t run into too many issues. Once it’s setup it seems to work reliably.
0
Feb 02 '21
[deleted]
4
u/JoenR76 Feb 02 '21
How long ago was this test? The first version of WSL had problems with unreliable I/O operations. Wsl 2 shouldn't have this. It's because they have included a full Linux kernel in Windows, instead of trying to translate all operations.
0
Feb 02 '21
[deleted]
2
u/YumKa Feb 04 '21
I stumbled upon IO issue while accessing windows fs from WSL2. Doing a simple yarn install took 20 minutes on a medium sized project. Copying it to WSL2 fs, doing the same install and it took seconds.
3
u/HenBagle Feb 02 '21
I've never experienced slowdowns that drastic, but I've found that storing files on the Linux side rather than the Windows side has sped up certain things massively.
1
u/slykethephoxenix Feb 02 '21
Which distro are you using? Does it do this for Windows paths, Linux paths, or all paths?
22
u/dewaldels Feb 02 '21
I’m more a webstorm user myself, but I do admire what VS code has achieved
8
8
u/slumdogbi Feb 03 '21
Webstorm is literally miles ahead in everything
1
u/zephimir Feb 03 '21
Like..?
2
u/r3versse Feb 03 '21
Simple case scenario, you have a function in a file that is used in multiple files. You want to
Shift the file in a different folder
Rename the file
Rename the function
Change export type to default
Any of these cases will force you to edit all the locations where the function is used manually. Shift+F6, and bam, it is done automatically. Feel free to correct me though, because it's been some time since I've used VSCode for production scale projects
9
u/oskiii Feb 03 '21
Hmm, at least when moving the files to a new location VS Code offers to automatically change all imports.
1
u/Infiniteh Feb 12 '21
Intellij IDEA (which includes all functionality from Webstorm) changes my imports when I move a file.
1
0
u/slumdogbi Feb 03 '21 edited Feb 03 '21
I won’t sell it for you. You must use it to see it. But features like the excellent refactor tools and multi window support shows the gap between the two tools. I’m a vscode fan but vscode is a nice text editor. For making projects there’s nothing better than Webstorm
3
Feb 04 '21
Webstorm only looks like a JavaScript IDE which I think is the limiting factor here.
The fact that I can install a plug-in in two seconds to support code completion for any language C, C++, python, etc.. makes VSCode amazing.
1
u/dewaldels Feb 04 '21
Yeah it’s great, it’s a versatile tool. I do however prefer the type hinting and formatting and customisation of formatting per language of Webstorm. Plus the NPM integration is great
1
Feb 04 '21
I remember VSCode being released in college and stumbling across it while looking for a replacement to Atom. Other than using VIM I have not touched a single other code editor since.
1
u/great_monotone Feb 03 '21
Anybody use Brackets? (brackets.io)
3
Feb 03 '21
Years ago but I remember it being good at the time. Especially the expanding the case inside of the html
1
u/great_monotone Feb 03 '21
same here. i started using it years back for the live preview. i still use it sometimes for simple projects. it’s kinda zen.
-16
Feb 02 '21
I love VSCode but it is getting awfully bloated as of late
7
31
Feb 02 '21
Do you know what bloated even means? Literally every meaningful function of vscode is extracted into extensions. If it's bloated it's because you made it so.
-6
Feb 02 '21
...except for that little Electron bit that it's all based on?
43
u/DrDuPont Feb 02 '21
I think VSCode is actually proof that Electron apps can be well made, frankly
11
u/keb___ Feb 02 '21
I agree... partly. VSCode is definitely the smoothest Electron app I've ever used. However, I recently switched back to Sublime Text and the difference in snappiness/performance is instantly noticeable.
10
u/folkrav Feb 02 '21
VS Code plays in the same fields as IDEs for some languages. Can't really say the same for Sublime, while it's most definitely a good editor.
1
u/keb___ Feb 02 '21
I agree, they are definitely in different leagues at this point. I tend to reach for VSCode (or other IDEs) when I'm facing a larger codebase. The intellisense/code-completion is invaluable.
-2
-6
Feb 02 '21
I don't disagree... but it's still a 90MB download, and 250MB install - without extensions.
Seems like an awful lot of wasted space if 'every meaningful function of vscode is extracted into extensions'...
4
u/DrDuPont Feb 02 '21
While you make a point, it's a sad reality that most desktop apps don't really give two shakes about bundle sizes. And VSCode is doing better than its competition – PHPStorm clocks in at 750MB.
0
Feb 02 '21
[deleted]
18
u/grantrules Feb 02 '21
Lol.. those moments when I accidentally launch VS instead of VS Code.
8
5
Feb 02 '21
At one point I had to have 3 copies of different versions of VS installed side-by-side on one machine, because various versions of their BI dev tools would only work with very specific versions of the server software... it was in a constant state of whack-a-mole, upgrade this dependency to get THAT version working, but it broke something in THIS version because of a shared DLL, etc, etc...
-1
u/troglo-dyke Feb 03 '21
Traditionally, we only saw professional developers but we're seeing a really broad set of users – people doing DevOps
This is painful to hear, DevOps is part of development
-13
Feb 03 '21
VS Code is probably everyone's first code editor (IDE). Its an awesome piece of software for people of every level. Although its heavy on the machine due to its reliance on ElectronJS, but it has still got a lot of things right which many text-editors haven't. LSP and DAP are two of these features. I still use the VS Code debugger for many of my projects.
But maybe once you are experienced enough with programming, its logical to shift to NeoVim (with NeovimQT). Neovim's biggest disadvantage is its lack of out of the box features which some might consider its biggest strength. Vim based workflow makes you faster. A lot faster. Its quick to open and easy on the machine. With the upcoming 0.5 version, it will probably be the best out there.
I know of VSCode's Neovim extension which by the way it great, but its nothing like Neovim on terminal.
Anyways, its ultimately the code you write that matters. Use any editor.
8
u/Jsn7821 Feb 03 '21
Everyone's first editor...? It's only been around for a few years. Am I that old
1
-33
u/onesneakymofo Feb 02 '21
VSCode ain't it, chief. Check out https://onivim.io/ and thank me later.
0
Feb 02 '21
[deleted]
-19
u/onesneakymofo Feb 02 '21
I mean Emacs, Vim, and Subliime Text are >>>>>>>> this way, but I'm trying to help you VSCode peeps find greener pastures.
-71
u/onesneakymofo Feb 02 '21 edited Feb 02 '21
Bloatware - hard pass
Edit: for all my downvoters out there, I bet you 2 $GME if you used https://onivim.io/, you would all upvote me in a year's time. :)
27
u/fdebijl Feb 02 '21
I don't think you know what bloatware means
-11
u/onesneakymofo Feb 02 '21
Sure, Electron sucking down memory; VSCode being unable to parse through any log files over 30,000 lines; good luck with more than ten tabs.
And this is without many extensions installed.
I'll take my downvotes and stick to Sublime Text and Vim.
19
u/NovelLurker0_0 Feb 02 '21
Compared to what? Notepad?
-14
u/keb___ Feb 02 '21 edited Feb 02 '21
Vim, Emacs, Sublime Text, Geany, Gedit. None of which offer the same combination of extensibility + ease-of-use of VSCode, however.
0
Feb 02 '21
use both i have a bunch of extensions and plugins in vim and its super easy to use and setup..
-6
-2
3
0
Feb 02 '21
[deleted]
8
u/peekyblindas Feb 02 '21
I see your points (aside from Frontend development, which is very very good using VsCode) - but the question is, which text-editor has adequate support for the most popular, but disparate, languages (bonus for being free [angry shoutout to community intellij that doesn't even provide thw most basic syntax highlighting for js/html/css)? This is not necessarily a rhetorical question, but I find it astounding that I can write Java, Python and JS with the exact same editor (the implications for fullstack are clear).
I am sure that less popular languages (say Haskell or similar langs) suffer from the double edged sword problem, but I dont really see an alternative right now. It should be pointed out that many editors have a plugin system for these languages, but so far I haven't felt that the editor itself knows about these plugins, so I feel at home writing in these different languages. Also it should be pointed out that Java for instance is getting pretty solid, but intellij still beats it for refactoring/debugging/autocode and stuff.
In short, I find it probably provides the absolute best experience for multi-language codebases for the more popular languages, especially if JS/TS is one of them.
On a minor note, I find it to be beautiful and polished and an absolute pleasure to work with. I tend to like the json/textual format for theming/settings. My codebase is relatively small, so I haven't hit any perf problems (I can blame the TS server for the perf problems i do have), I think).
27
u/smootex Feb 02 '21
This is very strange criticism to me because it is not at all in line with my experience and the parts that I see as true are not fair criticism.
You complain about having to use plugins. I see plugins as a good design decision. It reduces bloat and gives you freedom in how you want your editor to work. Our software org has even created our own plugin to facilitate development, something that would not be worth the effort in any other editor (and this plugin functionality is not offered in any IDE). I am perfectly happy to use an editor that doesn't require 8+ GB of ram and 50 GB of HD space out of the box and I am perfectly happy not to rely on Microsoft for everything because frankly the community often does a better job.
You complain about real world performance. I don't mean to be rude but this sounds like a complaint from someone who does not have experience with other IDEs. Everyone I know started switching to VS Code originally because of the performance. It runs great, it's fast to start up, its responsive on my very old personal laptop, it's stable and doesn't crash (looking at you Atom). This is why it became popular originally. You talk about large files but VS Code handles large files quite well compared to other IDEs. What are you comparing it to to come to this criticism? If you're really running into issues you're probably dealing with something that shouldn't be in an IDE at all. Stick to vi or notepad if it's so big it chokes VS Code.
You talk about it being too difficult to configure. Once again I'd ask what other IDEs you have experience with because that is an . . . odd complaint in the context of the current IDE market. It is significantly easier to setup than any other program with a similar feature set. This also seems to directly contradict your earlier complaint. You said it doesn't have enough out of the box and then you say there's too much to configure? Do you want more or less options? I don't get it.
VS Code isn't perfect but it got popular because it improved so much on what other editors were doing. If the "good editor that can be easily expanded into a more full featured IDE" model doesn't fit what you're doing that's fine. There are still uses for the big IDEs. I'd probably go back to IntelliJ myself if I had to write Java again. Your complaints mostly come across as contrarian though.
0
Feb 02 '21
[deleted]
7
u/thelegend_200 Feb 02 '21
Are you really comparing sublime with vscode?
Sublime is just a text editor with extremely minor ide features while vscode provides a ton of features that you would normally find in full fledged IDEs that as above user mentioned require a huge amount of ram and resources to run smoothly.
As for settings, why not just use search? That's just nitpicking at this point.
-2
u/mountainunicycler Feb 03 '21
Yes, sublime is comparable to vscode... and with plugins, it can do basically everything vscode can.
At least, when I switched back I noticed no major missing features.
And the performance difference is so huge it’s insane... with sublime you just never think about it. 300 files open in four repos for a month? Sublime doesn’t mind. I can find any file I need in any one of the 5+ repos I regularly touch in a given month in seconds.
5
u/aniforprez Feb 03 '21
with plugins, it can do basically everything vscode can
Patently false. The sublime API is woefully underpowered. You'll never get the level of extensions with sublime. And I know because I tried going back to sublime and half my VSCode extensions have no parallel. You also don't have the debugger that's as powerful as VSCode
5
u/Cheshamone Feb 02 '21
The real world performance is definitely the main thing I dislike about VS Code, coming from sublime. It's very noticeably worse for me. Not worse enough for me to switch back, but definitely annoying.
4
u/Ask-Alice Feb 02 '21
compared to sublime, i've found VSCode to open large files with more performance.
4
u/smootex Feb 02 '21
Yeah I'm not sure what he's talking about. VS Code handles large files quite well comparatively. He's either running some plugin that breaks it or he's comparing the performance to something like notepad or vi which is an absurd comparison.
0
Feb 02 '21
[deleted]
3
2
u/smootex Feb 02 '21
vanilla versions of multiple other popular editors
Can you give some examples? While I often use the terms interchangeably, really VS Code is more of an IDE than an editor at this point. If you are comparing Code to something like notepad, vi, or some more specialized tool (large file viewer or one of those tail GUIs) that is an apples to oranges comparison. While you would be technically correct to claim notepad handles large files better that would be kind of an odd way to benchmark VS Code.
Of the popular IDEs that I have used Visual Studio, Intellij, Atom, Eclipse, xcode, Android Studio, all, in my experience, do not handle large files as well as VS Code. Sublime used to handle them well (though again I'm not sure that's a fair comparison as Sublime is a basic text editor) but that doesn't seem to be the case anymore.
2
u/Cheshamone Feb 02 '21
This is super interesting, I have sublime installed solely for those times that VS Code chokes on a large file. I haven't had too many issues lately so maybe VS Code is better than it used to be, but I still feel input lag to a certain extent with VS Code that I didn't have with sublime.
2
u/smootex Feb 03 '21
Sublime is always going to be a bit more responsive (it's set as the default editor for .txt files on my PC for that reason) but it seems to have gotten worse with very large files over time. When you talk about input lag are you talking about just .txt files or are you talking about code files that are straining all the IDE-like features? Because yeah, if I load a 40k JS file it's going to take a long time to initialize all the language features. That's just the reality of an IDE. Sublime doesn't have all that stuff out of the box.
1
u/Cheshamone Feb 03 '21
My main issue is autocomplete of any sort in any file is obnoxiously slow. For instance, I use emmet to autocomplete CSS and build out html quickly and it has a noticeable lag between when I type a shortcut and it actually expanding them out. Sometimes it fails completely because I'm typing too quickly. This is a native feature of VS Code, extensions are often worse. :p
0
Feb 02 '21
[deleted]
2
u/SpeedDart1 Feb 02 '21
Well webstorm is awesome but it’s super pricey. If you are a student you can get it for free though, which is cool.
6
0
0
Feb 02 '21
[deleted]
3
u/folkrav Feb 02 '21
For almost any other language than JavaScript/TypeScript, Jetbrains' IDEs are the very opposite of awkward.
1
Feb 02 '21
have you heared about our lord and savior vim?
1
u/folkrav Feb 02 '21
Yes I did, and I use it quite a lot, actually. Even with LSP and the 20 something plugins I have to use to get IDE-like features, it's not remotely the same as a full-fledged IDE - especially with dynamic languages. I gladly pay the license just for the refactoring tools and debugger, they're on another level. And to be perfectly honest, I more or less am perfectly content with their IdeaVIM plugin, it has great emulation for basically all plugins I rely on in vim (surround, easymotion, commentary), so I use actual vim less than I used to (which used to be full-time).
YMMV, of course, depending on how important those features are for you. They save me too much time to get by without them, so I pay, but I did do perfectly fine with just vim for a couple of years too.
1
0
Feb 02 '21
[deleted]
-3
u/onesneakymofo Feb 02 '21
BuT VsCoDe iS fReE
Tell that to my machine that's losing 3GB of memory thanks to Electron. loool
161
u/fdebijl Feb 02 '21
The developer experience in VSCode with TypeScript is so seamless at this point that I would frankly recommend people starting out in JS to just go straight to TS.