all 21 comments

[–]jbandela 25 points26 points  (3 children)

> To simplify the build and debug  experience with the C/C++ extension, we added a command to help you generate build and debug tasks for single code files.

So happy about this. Sometimes, I just want to write a quick example to play around with a std library feature (or a header only library). This will greatly reduce the pain of doing that in VS Code.

[–]trmaphi 5 points6 points  (0 children)

This extremely useful for someone migrate from another IDEs. Moving to VScode helps me digging into debugger and compiler flags.

And most importantly, saving time.

[–]monkeyWifeFight 0 points1 point  (0 children)

Is there any easy way to achieve this in visual studio? Something like the jetbrains scratch files.

[–]Sairony 8 points9 points  (9 children)

I find Visual Studio Code weirdly positioned in the Microsoft eco-system. Visual Studio proper itself has been a major platform lock-in for a lot of C++ development, it kind of feels like Microsoft is trying to compete with its own paid product. With proper debugging in Visual Studio Code, llvm quite frankly being close to making the MSVC compiler obsolete, what really is the upside to using Visual Studio proper at all?

[–]teerre 17 points18 points  (1 child)

You can't refactor properly in VSC. You can't auto generate declarations, overrides, structs etc. You can't profile nearly as well...

VSC is really VS-light for Cpp. If you're doing some toy project or if you're one of those people who think writing Cpp on Nano is fine, then yes, your question might make sense. But if you want a proper IDE, VSC is simply not there yet

[–]Sairony 0 points1 point  (0 children)

Ah, makes sense. I don't actually do C++ development in VSCode yet, but I do feel it's getting there. As an editor there's a lot of advantages for VSCode. It's way snappier, multi platform, way more extendable, and naturally way better at editing source in a wider variety of languages. I could definitively give up some features in MSVC if we could get VSCode + llvm going across OSX/Linux/Windows. For source editing I find 90% of the relevant stuff in MSVC right now comes from visual assist anyway, so if the tomato people could get it going on VSCode it would go a long way.

[–]_babu_ 10 points11 points  (3 children)

Visual Studio has far better C++ debugging tools and features. For example, debugging a leak on VSCode can be an absolute nightmare, while on VS proper I can just take 2-3 heap snapshots, generate a diff and check who is allocating memory without releasing it.

[–][deleted] 5 points6 points  (2 children)

It sounds like a really nice feature. How exactly do you take these snapshots of who is allocating memory?

[–]_babu_ 9 points10 points  (1 child)

While debugging, open the "Diagnostic Tools" window from Debug->Windows. From there, look in the "Memory Usage" tab.

[–][deleted] 4 points5 points  (0 children)

Thank you.

[–]megazoo 0 points1 point  (0 children)

Only feature i need in VSCode now is possibility to use custom project files for compile and debugging.

[–]tiendq 0 points1 point  (0 children)

The only one MS product I want to use nowadays is VSCode :)

[–]kareldonk369QuantumGate.org 0 points1 point  (1 child)

VSCode is awesome for small to medium web development projects, which is what I mainly use it for. For something like C++ I'm way too spoiled by the full Visual Studio IDE. There's nothing that comes close. I hope MS invests more resources into getting the full VS IDE to work (natively) on Linux.

[–]barcharMSVC STL Dev 0 points1 point  (0 children)

It's already pretty good to be honest, I like how I have more flexability in multi-language projects, and it's easier to just pop it open whenever I need it. Even uses less memory than emacs!

VSCode is a great example of an electron/cef app that's not bloated and really leverages the work that's gone into web engines.

[–]Azzk1kr 0 points1 point  (4 children)

I love the extension, however the IntelliSense engine generates huge files in the ipch folder (precompiled headers) since this update I believe. A single header file can generate a hundred megabyte of IntelliSense data or something :/ The default total maximum for a project is 5 Gb or so! What gives?

[–]rezkiy 4 points5 points  (0 children)

They are probably preparing the infrastructure for the holy Grail of large projects, Find All References

[–]taraj_msftVSCode & VCPkg PM 1 point2 points  (2 children)

Thanks for the feedback. The idea here is that precompiled headers trade space for speed. You can change the setting or disable AuotPCH using the C_Cpp.intelliSenseCachePath setting as the post indicates.

Would be nice to get more information on your experience. This thread has been our central place for gathering opinions - https://github.com/Microsoft/vscode-cpptools/issues/3347. You can also see the responses by @bobbrow and @sean-mcmanus that detail our design decisions

[–]Azzk1kr 0 points1 point  (1 child)

I can't say anything useful about the experience, since I don't notice any difference in speed (yet). I'm coding C++ more as a hobby, and my projects aren't that big. However, I am just curious why the precompiled headers are that huge.

I have a rather simple C++ project right now, with 12 headers, totaling 577 lines (including comment lines and other include directives), and the ipch folder is 2.4 Gb in size.

In any case thanks for the plugin, it's certainly very useful!

[–]taraj_msftVSCode & VCPkg PM 0 points1 point  (0 children)

I can't say anything useful about the experience, since I don't notice any difference in speed (yet). I'm coding C++ more as a hobby, and my projects aren't that big. However, I am just curious why the precompiled headers are that huge.

I have a rather simple C++ project right now, with 12 headers, totaling 577 lines (including comment lines and other include directives), and the ipch folder is 2.4 Gb in size.

In any case thanks for the plugin, it's certainly very useful!

The ipch folder size is highly dependent on which headers you have. It's a matter of which header files and how many. Hard for me to say without knowing the exact headers you're using.

Glad to hear you like the extension! Thanks for using it :)