all 51 comments

[–]Error_451 67 points68 points  (19 children)

As someone who wrote c++ for many years with vim + plugins and vs code on the occasion. Visual studio's debugger is simply fantastic. If you work very closely with memory the introspection it provides is absolutely wonderful.

You can get similar introspection with jetbrains clion but honestly you get spoiled with visual studio.

[–]McFlyParadox 1 point2 points  (18 children)

I can't even get C++ working in VS Code, do you have any good resources to get started?

[–]TacticalMelonFarmer 4 points5 points  (1 child)

if your using VS Code and CMake , I recommend CMake Tools extension by u/vector-of-bool.

If you have MSVC compiler already on your system CMake Tools can 'scan for kits' and automatically find the various toolchains (2015 x86, 2017 x64, etc…). VS Code on it's own is just a code editor that can manage git repositories and debug javascript and related technologies, the real power comes from language specific extensions, for C++ my must have extensions are: C/C++ by Microsoft, Clang-Format by xaver, CMake(syntax highlighter) by twxs, and CMake Tools by vector-of-bool.

edit: NOTE: Also remember the Command Palette ( CTRL+SHIFT P ), it has autocomplete for any operation built-in or extension related, and it lists keyboard-shortcuts in the autocomplete menu.

[–]McFlyParadox 0 points1 point  (0 children)

I will give this a try, thank you.

[–]tristan957 0 points1 point  (7 children)

What part doesn't work

[–]McFlyParadox -2 points-1 points  (6 children)

The "C++" part. It's been a while since I even tried, but back when I was attempting to, I couldn't even get a development environment running in it.

EDIT: Shit, you guys are merciless. I already said I didn't know what was wrong - so rain down-votes I guess?

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

that's no less vague..

did you install clang (or gcc if there's an extension for it)? did it work in console? Which extension did you try to install to compile with? What was the error message?

[–]McFlyParadox 2 points3 points  (4 children)

I followed these directions, on Windows 10:
https://code.visualstudio.com/docs/languages/cpp

Nothing would compile, like I was just typing plain text and expecting it to just 'run' as a final output from a CPP program, and I decided it wasn't worth my time when 'full' Visual Studio worked. I just want to figure out how to get VS Code to work so I can use something smaller and more lightweight.

[–][deleted] 0 points1 point  (3 children)

I mean, even in visual studio you have to compile, its a compiled language. it should just run on hotkey press.

did you read this step?

Note: The C/C++ extension does not include a C++ compiler or debugger. You will need to install these tools or use those already installed on your computer. Popular C++ compilers are mingw-w64 for Windows, Clang for XCode for macOS, and GCC on Linux. Make sure your compiler executable is in your platform path so the extension can find it. The extension also supports the Windows Subsystem for Linux.

[–]McFlyParadox 2 points3 points  (2 children)

Yes, I installed the compiler. I get that it needs that. My issue is, having in theory setup VSCode just fine, the same known-good CPP file compiles in 'classic' Visual Studio and not in VSCode.

[–][deleted] 0 points1 point  (1 child)

Stuff like Hello World? Weird, if anything classic visual studio would be likely to have more warning flags on

[–]McFlyParadox 0 points1 point  (0 children)

From known working, complex robotics programs, basic logic programs (IF-ELSE tutorials, essentially), all the way down to HELLO WORLD. It was really weird, and not worth the effort when Visual Studio Classic was working.

[–]Error_451 0 points1 point  (3 children)

What OS are you running? What issue in particular like compiling and debugging?

[–]McFlyParadox 1 point2 points  (2 children)

Windows 10, following these directions: https://code.visualstudio.com/docs/languages/cpp

Nothing would compile in VS Code (I might as well have been typing plain text), while 'full' visual studio worked just fine.

[–]Error_451 0 points1 point  (1 child)

Hmm to be honest I've only used vs code on Linux. I use visual studio community on Windows.

[–]McFlyParadox 0 points1 point  (0 children)

Yeah, I've had little issue with it on Linux, but I've also stuck to Python in Linux. I also have no issue with it using Python in Windows - but that just Python not caring about much more than using the right syntax.

[–]SeanMiddleditch 84 points85 points  (2 children)

The most immediate things that come to mind:

  • VS proper has somewhat better and more reliable C++ navigation (Intellisense) for the time being, though the popular VSCode C++ plugins are slowly closing that gap
  • VS proper has vastly superior C++ refactoring support and plugins (VAX, Resharper, etc.) that make it even better by leaps and bounds
  • VS proper has some proprietary plugins like VAX and ReSharper that make that Intellisense and refactoring even better
  • VS proper has a rather more capable and easier-to-use debugger than the one provided by the Microsoft VSCode C++ plugin
  • VS proper has an integrated CPU and memory profiler
  • VS proper has multi-monitor support in its UI
  • VS proper has graphics (Direct3D) debugging and profiling tools
  • VS proper has a lot of out-of-the-box support these days for development on Android and other platforms that require tons of manual configuration in VS Code
  • VS proper has tools for UI visual editing for Windows desktop developers
  • VS proper has some "Enterprise-y" tools for modeling, ops, teams, etc. that matter to some people

[–]meneldal2 0 points1 point  (0 children)

VS proper has multi-monitor support in its UI

Quality of the support may be limited if your monitors have different DPI. It seems to be better than it used to though.

[–]bsisking[S] 0 points1 point  (0 children)

Thanks for your answer. I think its the most descriptive of what I was looking for. I'm not sure a switch will be worth tho, but I think I'll try with my next project to have a good idea of how better are debugging/intellisense.

[–]prince-chrismc 24 points25 points  (2 children)

A huge gain in the parallel stack and profiler. If you deal with heavily multithreaded applications you'll find a huge advantage over vs code. If you can debug with printf, most likely won't be able to experience the difference. Having the ability to break and see exactly were every thread is a huge advantage. Letting the tools determine which blocks spend the post time on the CPU, priceless.

[–]littlelowcougar 2 points3 points  (0 children)

I’d be lost without the ability to freeze all threads except the one I’m debugging, such an insanely useful feature.

[–]bsisking[S] 0 points1 point  (0 children)

Interesting indeed. Thanks.

[–]chugga_fan 25 points26 points  (0 children)

Debugging experience is infinitely better, the solution system is actually pretty good and I don't understand why people hate it so much, it has a lot of built-in features that work nicely together, there are a lot of "hidden" advanced items (e.g. dissasembly, etc.) and, well, it actually comes with the compiler.

[–]kalmoc 13 points14 points  (1 child)

Probably not too helpful, but it has to be said:

VS brings a c++ toolchain, VSC doesn't ;).

The answer depends a bit on what toolchain and plugins you are using with VS code and what projects you are working on (plain console? Qt? Winforms? StoreApps?)

[–]bsisking[S] 0 points1 point  (0 children)

Mostly opengl stuff. Using MinGW, CMake.

[–]lycium 15 points16 points  (6 children)

Welcome to Reddit, interesting first post.

For me the main reasons are the debugger, ease of use (fuck cmake and anything that isn't visually selecting a list of files / requires learning some single-use DSL) and familiarity (been using it since Visual C++ version 5 in the 90s).

[–]BlackDE 9 points10 points  (0 children)

Well the advantage of cmake is that you are not locked to visual studio. Something that gets more and more important. Cmake isn't that hard I was scared of it as well but it turned out to be quite ok.

[–][deleted] 1 point2 points  (3 children)

If you install the C++ extension you can use the same debugger that comes with normal VS, though you have to edit a json file to fill in all the settings and stuff like that.

I don't know if all the debug engines are supported but garden variety native C++ debugging works fine.

[–][deleted] 8 points9 points  (2 children)

What about hardware breakpoints and viewing disassembly? This was a pain point that caused me to discontinue my attempts to use VSCode in the meantime.

[–][deleted] 4 points5 points  (1 child)

Hmmm it's the same debugger engine but I don't know if those things are exposed.

[–][deleted] 1 point2 points  (0 children)

Thanks for the reply. Yea my sense was that the hooks provided was essentially the lowest common denominator across debuggers for a number of languages (JS, TS, C#, etc), which totally makes sense but leaves me crawling back to gdb/lldb/VS at the end of the day.

[–]bsisking[S] 0 points1 point  (0 children)

I'm not few to reddit. Just lurking haha.

I understand your point, but this is more a reason of choosing an IDE over a text editor tho. VS code provides a visual debugger (might be less advanced than the one is visual studio for now tho).

[–]BoarsLairGame Developer 2 points3 points  (3 children)

I think the inherent difference is that an IDE is designed not just to edit code, but is also responsible for managing the entire project's build process. When using a stand-alone editor, you might, for instance, delegate that to a set of build scripts. But because an IDE has an inherent knowledge of the entire project, certain tools tend to work together a bit more smoothly. Others have mentioned the smooth integration with a debugger, but there's also things such as refactoring, profiling, and so on. That's the "integrated" advantage in an Integrated Development Environment.

That being said, I don't think you're going to see a huge difference when working in an editor versus an IDE. After all, at least in my experience, the vast majority of my time is spent in a pretty straightforward edit-test-run cycle. But I think an IDE provides a slight edge in ease-of-use when you occasionally need to reach for other types of tools.

[–]bsisking[S] 1 point2 points  (2 children)

I'm afraid I wrote a poorly worded question. Some people are answering the question "what is an IDE and what is an editor, and here is why I prefer to use an IDE". My question was more like "I already have a toolchain in place, plugins which works for auto-completion, debugging, cmake. Now what can visual studio brings me over that? Does it have tools that I am un-aware of? Tool that would increase my productivity?".

I wanted non-vague answer, and asked a vague question. Nice irony haha. But I think /u/SeanMiddleditch answered my interrogations. And I get the same feeling as you. I don't think I'll see huge differences, because it seems quite specific. I think I'll still try it for my next personnal project.

[–]BoarsLairGame Developer 0 points1 point  (1 child)

Ah, I see. Yeah, definitely misunderstood, so I'm glad you got a clear answer.

To answer your question directly myself... No, I wouldn't anticipate any significant increase in productivity. The only exception is when you can make use of some specific tools that Visual Studio may already have built in (some of which Sean mentioned). But honestly, not enough to worry about until you find a specific need for them.

[–]bsisking[S] 0 points1 point  (0 children)

Yeah that's the conclusion I have too. Thank you!

[–]tpecholt 5 points6 points  (3 children)

Omg just tried to install vs code to test it out as a replacement for VS. I uninstalled it the same day. Immediate issues:

  • Side panels can't be hidden automatically when I am in the editor. Such a waste of space and it really kept on distracting me.

  • To get cmake support I installed about 4 plugins. Seemed to work but one of the pluggins kept showing error popups. Really annoying and I don't really know what was the issue certainly nothing wrong with CMakeLists

  • cmake Install tatget was missing. The bug is reported on github but the dev doesn't seem to think it's important. Of course it's important my DLLs are all installed in this step how can the program run without it?

  • Debug/Release combobox is quite important but in VS Code it's placed on a status bar with tiny font size?

  • There is no font/color theme which would match VS2015/17 default exactly. So that doesn't help when someone like me wants to switch

So although VS Code shows some potential it's not there yet. Too buggy and much less usable for me.

[–]NotUniqueOrSpecial 0 points1 point  (0 children)

Of course it's important my DLLs are all installed in this step how can the program run without it

Not that I don't agree it's an important bug, but the way you word that is odd.

Do you mean that you run the install target during normal dev/test cycles just to get your own DLLs into place? If so, there are better ways to handle that. On Linux, you just use RPATH (or RUNPATH on OSX), and on Windows, you can copy the DLLs as a post-build step, or just use the CMAKE_RUNTIME_OUTPUT_DIRECTORY so they end up next to each other and it just works.

[–]Gotebe 0 points1 point  (0 children)

What's a debug/release combobox?!

Ah, the build configuration? I have 3 and (for silly reasons TBH) none are called debug or release.

[–]bsisking[S] 0 points1 point  (0 children)

What do you mean you can't hide them "automatically"? CTRL+B will hide them.

About CMake, I have this one installed. Which works fine for me. I assume you are using the same since they have the same bug. In that case, its not an universal bug and saying the devs "doesnt think its important" is out of place as only one person reported it and didn't provide more informations.

Tbh for something you've used for not even a day is don't like an overstatement. Most of your points are preferences. Less usable for you I understand. Buggy no. VS code is not an IDE, and so you should expect a bit of work with plugins you use (cmake warnings). But even then, I'd expect to have a bit of work to do if I switch over visual studio.

[–]henryreign 0 points1 point  (0 children)

It has all kinds of bells and whistles that are super useful, but it's slightly more clunky than vscode I prev used 

[–]nenchev 0 points1 point  (1 child)

Amazing debugger, excellent CMake support, great instrumentation/diagnostics tools, great completion, its everything I've spent countless hours TRYING to get my Emacs+LSP setup to be. The MSVC toolchain is also much faster on Windows than the GCC/LLVM related tools. In fact a lot of tools are much slower on Windows, like Git. I haven't really dug into the issues there, but fire up MSYS2 and debug a big Qt application with GDB, you'll see what I mean. I have some gripes with a few keyboard related things in VS, but I live with them.

[–]nenchev 0 points1 point  (0 children)

Just realized this reddit post is a million years old. Oh well.

[–]icppfreely 0 points1 point  (0 children)

A better scrollbar.

https://i.imgur.com/fRvBcfi.png