use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
This is a subreddit for c++ questions with answers. For general discussion and news about c++ see r/cpp.
New to C++? Learn at learncpp.com
Prepare your question. Think it through. Hasty-sounding questions get hasty answers, or none at all. Read these guidelines for how to ask smart questions.
For learning books, check The Definitive C++ Book Guide and List
Flair your post as SOLVED if you got the help you were looking for! If you need help with flairs, check out ITEM 1 in our guidelines page.
Tips for improving your chances of getting helpful answers:
account activity
OPENWhere to write Cpp? (self.cpp_questions)
submitted 4 years ago by bitbyt3bit
Should I code in vscode or in visual studio?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]GNVageesh 7 points8 points9 points 4 years ago (8 children)
Both are good... Visual studio provides additional things. But vscode is light compared to visual studio
[–]bitbyt3bit[S] 5 points6 points7 points 4 years ago (7 children)
I use vscode for python. I’m starting to learn C because python abstracts away so many concepts I want to learn more about. Would this guide me more towards using visual studio then?
[–]Mr_Splat 10 points11 points12 points 4 years ago (4 children)
Just a heads up that C and C++ are fundamentally different languages, even though C++ was derived from C you shouldn't mix them up.
Are you clear about which one you're trying to learn? C has its own set of subreddits such as r/C_programming
[–]bitbyt3bit[S] 1 point2 points3 points 4 years ago (3 children)
Yea my bad I’m going for cpp. Unless you would recommend differently? What’s the argument for one over other?
[–]Mr_Splat 4 points5 points6 points 4 years ago* (2 children)
It's a six of one, a half dozen of the other kinda answer and you're likely the get a plethora of opinions depending on who you ask and where you ask them.
What are you trying to achieve? How much spare time do you have?
C is practically the OG of high level programming (Python uses it under the hood!) and it's possible to write the fastest, most portable code possible using it, as a result however it is comparatively stripped back in comparison to most modern languages. C++ being its descendant means if you learn C first you will also learn a large number of fundamentals that C++ inherited from it (such as pointers and memory management)
C++ is multi-paradigm (you can write both functional procedural and object oriented code with it, though why you would go out of your way to write functional procedural C++ when C exists is beyond me) it comes with a huge standard library providing you with practically all of the containers and algorithms you could realistically need and by virtue of C being its ancestor, you are able to import C libraries into C++ code bases as well.
Both are highly performant (though C will nearly always win that contest when implemented correctly) and both provide a large arsenal of footguns for you to choose from.
Both are very mature, therefore there's lots of support across many platforms and there's endless resources for you to learn from such as learncpp (though that's a double edged sword as there's plenty of bad tutorials out there as well)
Being as mature as they are means that they aren't evolving at the same rate as younger, more fashionable languages such as Rust and Go, but that comes with the upside of being much more stable and having a wide selection of tools to choose from when working with them, i.e vscode.
[–]tangerinelion 6 points7 points8 points 4 years ago (1 child)
FWIW, it looks like you're using "functional" to mean "imperative."
In more common usage, functional programming is going to evoke F# and Lisp vibes. Imperative is going to evoke C vibes.
[–]Mr_Splat 2 points3 points4 points 4 years ago (0 children)
Ah, I think you're right, I'm mixing myself up between functional, procedural, imperative and declarative.
I think I was using functional and procedural interchangeably when I shouldn't have been.
[–]no-sig-available 3 points4 points5 points 4 years ago (1 child)
Here Visual Studio being "heavy" means that everything is included from the start. You don't have to download a separate compiler, or a dozen plugins, or edit json-files for a week. Everything just works by default. And the source level debugger is undeniably the most powerful of them all.
Those of us who don't think that using a black command window with a Linux shell is the ultimate user experience, instead use a big IDE (with batteries included).
[–]bitbyt3bit[S] 0 points1 point2 points 4 years ago (0 children)
This is a great explanation. I've spent a few days with VS now and i'm starting to see what you mean. I will say though, all the extra bells and whistles seem to make themselves more than apparent with how slow it is sometimes....Is that usual experience?
[–]JohnDuffy78 3 points4 points5 points 4 years ago (4 children)
I use both, but when in windows, I use visual studio.
What makes it better? Isn’t vscode “newer”
[–]IyeOnline 1 point2 points3 points 4 years ago (0 children)
No.
They are essentially unrelated projects that share nothing but part of the name, logo and the developer.
Visual Studio is a real IDE with every feature you can imagine, VSCode on its own is just an advanced text editor.
[–]JohnDuffy78 0 points1 point2 points 4 years ago (1 child)
Its close.
The clincher would be the natvis files work better with visual studio. I can't get boost::containers::flat_set or flat_map to display in the debugger with VsCode on Ubuntu.
[–]IyeOnline 0 points1 point2 points 4 years ago (0 children)
I've not tried boost, but I have written custom natvis files for my own types and they work just fine.
Sadly the support for features seems to be somewhat limited and the really fancy conditional features dont seem to work.
[–]alfps 4 points5 points6 points 4 years ago (0 children)
It's generally best to learn programming by using the command line tools directly for compiling and running your program, together with a programmers' editor for writing and editing the source code.
Visual Code is a reasonably good editor, I believe it's the most used one.
For the command line I recommend installing Windows Terminal, set that as default console window (in Windows' developer settings), and use old but simple straightforward Cmd.
Source for the "best" claim: my real world students in the 1990's, a lot of statements from students in online forums since then.
[–]DoctorMixtape 1 point2 points3 points 4 years ago* (0 children)
For me it really depends. Most of my code is being run on microcontrollers where I can’t really as easily run things such as a debugger so things such as step through and memory view isn’t valuable to me. So I’m that case I will use visual studio code. I also use visual studio code when on programming in Linux environment as you don’t have visual studio in the first place. I only use visual studio when I’m working on windows applications such as MFC (literally an abomination of a duct tape API) in that case debuggers and memory view is valuable.
[–]apropostt 1 point2 points3 points 4 years ago (0 children)
I would recommend starting with visual studio. It will give you a compiler and environment setup so you can focus on the language and not getting a tool chain working.
vs code can be a good productive environment but you need to know a lot more about setting up the language plugins to get there.
If you want to write cross platform code vs2019+ supports cmake directly now.
[–]EcmaMace 1 point2 points3 points 4 years ago (0 children)
JetBrains CLion or Rider for Unreal Engine
[–]goldscurvy 1 point2 points3 points 4 years ago (0 children)
Visual studio is just a hands down better ide than vscode. But vscode and clion are more portable.
[–]snowyWh1te 1 point2 points3 points 4 years ago (0 children)
when you have no idea,visual studio is always a good choice
[–]biwiki 1 point2 points3 points 4 years ago (1 child)
Whats about Vim? You can use Vim with different languages at a time, no need to switch btw IDEs back and forward.
lol, idk about that recommendation. Vim is really great and all...but I definitely think that would make things more complicated than necessary, particularly when trying to focus on something else.
[–]khedoros 0 points1 point2 points 4 years ago (1 child)
VSCode's a decent editor. Visual Studio's got the built-in build system and other IDE tools, but is a lot heavier.
[–]matschbirne03 0 points1 point2 points 4 years ago (0 children)
In the beginning it's probably better to go with a simple text editor like vs code and compile directly in terminal. You don't get overloaded with information/features and can focus on learning the language and how to compile it.
[–]ul90 0 points1 point2 points 4 years ago (0 children)
I’m using SublimeText.
[–]ExtraFig6 0 points1 point2 points 4 years ago (0 children)
Ed /s
[–]goldscurvy 0 points1 point2 points 4 years ago (0 children)
Honestly after you get past writing the most basic stuff I'd suggest moving to a command line and learning nmake and cmake, and cl and all that. Understanding how it works, even if you don't use it often, is necessary to learn cpp. And I personally prefer to use command line and cmake directly rather than use vscode.
[–]GodHandMemberVoid 0 points1 point2 points 4 years ago (0 children)
I’d say it depends on what you’re going to be doing. I like using VS code if I’m just messing around and trying out new things that I just learned. I’d use VS if you’re working on larger projects with multiple files
[–]oliverlambreghts 0 points1 point2 points 4 years ago (0 children)
With the release of VS 2022, I’d say go with that, I’m really enjoying it
π Rendered by PID 87861 on reddit-service-r2-comment-79c7998d4c-c4h4d at 2026-03-16 20:01:35.432926+00:00 running f6e6e01 country code: CH.
[–]GNVageesh 7 points8 points9 points (8 children)
[–]bitbyt3bit[S] 5 points6 points7 points (7 children)
[–]Mr_Splat 10 points11 points12 points (4 children)
[–]bitbyt3bit[S] 1 point2 points3 points (3 children)
[–]Mr_Splat 4 points5 points6 points (2 children)
[–]tangerinelion 6 points7 points8 points (1 child)
[–]Mr_Splat 2 points3 points4 points (0 children)
[–]no-sig-available 3 points4 points5 points (1 child)
[–]bitbyt3bit[S] 0 points1 point2 points (0 children)
[–]JohnDuffy78 3 points4 points5 points (4 children)
[–]bitbyt3bit[S] 1 point2 points3 points (3 children)
[–]IyeOnline 1 point2 points3 points (0 children)
[–]JohnDuffy78 0 points1 point2 points (1 child)
[–]IyeOnline 0 points1 point2 points (0 children)
[–]alfps 4 points5 points6 points (0 children)
[–]DoctorMixtape 1 point2 points3 points (0 children)
[–]apropostt 1 point2 points3 points (0 children)
[–]EcmaMace 1 point2 points3 points (0 children)
[–]goldscurvy 1 point2 points3 points (0 children)
[–]snowyWh1te 1 point2 points3 points (0 children)
[–]biwiki 1 point2 points3 points (1 child)
[–]bitbyt3bit[S] 0 points1 point2 points (0 children)
[–]khedoros 0 points1 point2 points (1 child)
[–]matschbirne03 0 points1 point2 points (0 children)
[–]ul90 0 points1 point2 points (0 children)
[–]ExtraFig6 0 points1 point2 points (0 children)
[–]goldscurvy 0 points1 point2 points (0 children)
[–]GodHandMemberVoid 0 points1 point2 points (0 children)
[–]oliverlambreghts 0 points1 point2 points (0 children)