What should you choose to learn cpp programming? As I know both have support for language but does that really make any difference If I have to make a choice?
-
1possible duplicate of [What are some good compilers to use when learning C++?](http://stackoverflow.com/questions/77126/what-are-some-good-compilers-to-use-when-learning-c) – David Heffernan Jan 16 '11 at 21:18
6 Answers
At this stage, of learning afresh, you should not be worrying about compilers. Both are fine. Catching up the nuances of the compiler and if any difference does exist should occur latter, rather than at the start.
What would you make out of the differences at present when you are starting to learn the language ?

- 5,696
- 3
- 29
- 40
-
What would make a difference is how well the compiler represents the very soon future of the language. VS's implementation of C++0x features is limited and erroneous in some casess. Someone new may as well learn what will be the language when they're ready to enter the field. – Edward Strange Jan 16 '11 at 21:20
-
But you'll need to know the old too since legacy code will remain for many years. – David Heffernan Jan 16 '11 at 21:22
-
@Noah Roberts - I don't deny that. But even before starting you worry about compilers isn't asked for. For basic learning, I don't assume there are stratospheric differences between the 2 compilers. – DumbCoder Jan 16 '11 at 21:24
-
Well, actually for learning, now that you mention differences in the basics, there are. The VS compiler is MUCH more lenient on standard violations. The best in this area is obviously comeau, but g++ is definitely more pedantic than MSVC. – Edward Strange Jan 16 '11 at 21:32
I would recommend Visual studio 2010 express to start with, its a far more userfriendly experience where you have editor and debugger integrated, that if the goal is to learn c++ with as few other distractions as possible, you can download it for free from the link below:

- 1,304
- 1
- 11
- 28
If you're just learning, I'd recommend G++ but I'd recommend you get the newest one you can. This might be a little tougher than usual on win32 (you'll probably have to hand-upgrade mingw or something). So, you might do yourself a lot of favors installing Linux on a second partition or some old PC or something.
The main reason I'd recommend G++ over VS is the implementation of the NEW bits of the language. MSVC++ has some of C++0x implemented but a huge portion of it is not. Furthermore, they got a lot of stuff wrong and/or in some sort of half-way state (and sometimes what they say is "partially implemented" is only available in their C++/CLI language, features of which they include in their list of supported C++0x stuff). G++ on the other hand is pretty much THE implementation of the new standard that people making the standard are actually implementing. It's been forked to test new features, etc, and is much, much further along in implementing C++0x than any others that I can think of.
Why learn C++0x? Because this is what the language is going to look like now. Why learn the old when you'll just end up having to relearn like everyone like me has. With C++0x extending the language and changing the language in so many ways, it almost feels like it's totally new. In my opinion you'd serve yourself well by just learning what the future is going to be like rather than the past (and in VS's case, a bastardization of the two).
I use VS because I pretty much have to. If I was a newbie today I'd learn on G++ to get all the new goodies. I totally wish I could actually use it myself.

- 40,307
- 7
- 73
- 125
-
Since, the OP is a beginner, and there are no beginner texts for C++0x, this seems like bogus advice. Roll your own mingw? Not for the faint hearted. – David Heffernan Jan 16 '11 at 21:21
-
4And what debugger do you recommend for g++? A debugger is always a very useful tool for a beginner. – David Heffernan Jan 16 '11 at 21:23
-
I've downloaded `Code::Blocks` which comes with a GCC Compiler + Debugger (if that's not fine) – user15353 Jan 16 '11 at 21:28
-
You're stuck with gdb if you use g++. It's the one area where VS beats the gcc version. In my opinion, gdb is sufficient enough so that VS doesn't beat out the gcc solution on this point alone. – Edward Strange Jan 16 '11 at 21:30
Perhaps VS is better for beginners because it has the auto-completion feature.

- 22,411
- 10
- 48
- 86
-
3Well with gcc you also can have nice auto-comletion but need to use some good IDE (like netbeans). – UmmaGumma Jan 16 '11 at 21:14
Both Visual C++ and GCC are good compilers. If you want to use GCC, you might want to try out Qt Creator IDE. It has a very nice text-editor with vim builtin. On the other hand, with Visual Studio you have plenty of nice plug-ins such as Visual Assist X, ViEmu, etc.

- 13,511
- 40
- 107
- 156
GCC is good if you're wanting to create small programs which don't require much management, for example to just say "Hello world" or work a couple things out. Also, if you want the application to build on many systems like Linux or Mac, GCC is the option to choose.
Otherwise, if you're on Windows and want to create some massive project that needs loads of complex steps and stuff to build, Visual Studio is good.

- 2,546
- 4
- 30
- 46
-
-
"small programs which don't require much management" - Um, what about Linux, the operating system?! :S – Secko Jan 16 '11 at 21:24
-
@Secko that's written in C. But, that aside, Joe is talking out of his hat here! – David Heffernan Jan 16 '11 at 21:27