views:

834

answers:

12

I need to get up to speed with C++ quite quickly (I've never used it previously) - is learning through Visual Studio (i.e. Managed C++) going to be any use? Or will I end up learning the extensions and idiosyncracies of C++ in VS, rather then the language itself?

If learning in VS is not recommended, what platform / IDE do you guys suggest?

Edit: Can anyone elaborate on what VS will hide or manage for me when coding unmanaged C++? I really need to be learning things like pointers, garbage collection and all the nuts and bolts of the low level language.. does VS abstract or hide any of this kind of stuff from you?

Thanks for all the suggestions..

+3  A: 

Visual studio is not necessarily managed c++. You can compile it with that option, but it's not necessary.

In my opinion learning using visual studio is a great option since you can right into the code and don't bother much about the configuration of your project.

Edison Gustavo Muenz
+2  A: 

It all depends, first step would be to read quite a few books, some basic ones, and some advanced ones like effective C++.

Managed C++ is a very different beast to pure C++, besides VS lets you program in pure C++ anyway. So, if your goal is to learn pure C++, I do not think you need to learn the managed extensions.

Can you elaborate on why exactly you need to learn C++? what kind of project you will be working on?

Visual Studio, with its intellisense and help is a pretty good platform to be learning a language on.

Sam Saffron
+6  A: 

The Visual Studio IDE can be used with several languages: for example C#, managed C++, and also the real (unmanaged) C++, so:

  1. You can use VS for the real C++, not just for the "managed" C++.
  2. If you just want to learn C++ then, you're right, you don't want to be learning "managed" C++.
ChrisW
thanks chris - am i right in thinking 'visual c++' is the straight unmanaged C++?
flesh
"Visual C++" is commonly used to identify the products that use the Visual Studio IDE in combination with either standard C++ or Microsofts C++/CLI language
MSalters
@flsh If I read 'visual c++' (e.g. in a job ad) I'd assume it meant standard C++, using the VS IDE, and the Microsoft/Windows APIs.
ChrisW
ok, thanks for the responses
flesh
+3  A: 

Eclipse is an excellent IDE that works with many languages, including c++. The Eclipse CDT can be found here: http://www.eclipse.org/cdt/

sreenath
+2  A: 

My own experience: my very first attempt at programming was C++ in VS. Learning the syntax was relatively straightforward, but coming to grips with compiling/linking/etc. was more painful until I moved out of the IDE. Those details are largely managed for/hidden from you.

Having said that, if you're an experienced programmer, and especially if your goal is to work with C++ in VS (in a work or school environment, for example), than this is a viable quick-start option.

TSomKes
can you elaborate on what details are hidden? i really need to be getting to grips with pointers, memory management and the guts of C++ - presumably none of this stuff is hidden from you?
flesh
(Ha - I'm not sure I'm the best one to teach you. Much is still hidden from me.) VS doesn't hide the guts of C++ from you; you get just as much rope in an IDE as you do on the command line. That's a good thing; it wouldn't be C++ otherwise. What I was referring to was the fact that there's a lot that happens between code and executable. When I was first using VS, I didn't have any concept of a "makefile" (or equivalents), and I thought "compile" meant "push F5". Eventually, you'll want to know what's behind that curtain, even if you continue working in the IDE.
TSomKes
cool, thanks tsom
flesh
I do like to know what's going on behind the scenes, but I also like to break the things I'm going to learn into manageable chunks. This means that, if I'm learning C++, I'd like to have the environment as easy to use as possible. Once I've learned C++ to a reasonable level, then I'd study the other stuff.
David Thornley
Well said. Learning the language itself is no small task; adding an environment with many moving parts can be a major distraction.
TSomKes
A: 

For C++ I got used to Borland Compilers http://www.turboexplorer.com/. The differences between compilers are in the libraries they use (dlls and includes, but some of them are standard). I started with DevC++ (a free compiler http://www.bloodshed.net/devcpp.html ) and I liked it too. The language is the same. But the best is to try different compilers and use the one you like the most.

And the best for learning C++ is starting witth console applications.

yelinna
Sorry, but Borland compilers lack a lot of support for the standard, they are buggy, some stuff simply don't work with them.This is the nightmare I'm actually facing in my job, getting rid of the old crappy code that was created because of some "non-standard" way that Borland created their compiler.If that wasn't enough, their compiler, linker and IDE are really buggy. I have to reopen it several times a day.
Edison Gustavo Muenz
A: 

To quote MSDN on managed c++:

Managed Extensions for C++ was created to extend the C++ language, allowing you to use the .NET Framework and target the common language runtime without having to learn a new programming language.

Thus "Managed C++" is nothing that will help you learning C++. Besides, IMO the best way to learn a language is to learn its basics, not some extensions. This is not related to the compiler / IDE used. While VS might provide nice helpful features using a simple text editor with any command line compiler like g++ is perfectly fine too.

bluebrother
A: 

Most C++ books will not teach managed C++. But I recommend you learn both. I believe there is quite a market for both managed and unmanaged. Unmanaged is "classic C++" which has been used for ages, and managed is .net C++.

As to compilers, I would go with VS. It is the most updated and premeir compiler of the world. You can use all the other compilers just fine for learning, but if you ever do huge C++ projects they'll probably be in VS (disclaimer: I do not know this for a fact)

see the current C++ compiler choices (forum discussion)

CrazyJugglerDrummer
The MS compiler is good, but I've no reason to believe it's better than the Gnu compiler.
ChrisW
I mean, better just as a compiler. Obviously their IDEs, or lack thereof, are very different.
ChrisW
A: 

If you want to learn just plain C++ and a bare minimum of anything else. I would suggest installing cygwin and gcc/g++. The reason I recoment cygwin is from the question it seems you using windows. Otherwise if you are using a *nix type system you should already have gcc.

All you will need to do is create your c++ files in your favorite editor and compile. You will still have to learn how to use gcc and possibly make files (especially if you are making a non trivial project) but that is probably the bare minimum setup you could have for learning C++.

hhafez
You have a strange definition of "bare minimum". I'd say installing VC++ Express (free, one single applications) is a lot simpler than Cygwin + compiler + make + whatever else you need when going that route.
jalf
Have you used cygwin? It is not that complex for one. Second of all his issue is learning not installing (read the OP). All he needs to learn with cygwin is how to use the compiler. When using an IDE you need to learn more than just how to compile. I am not advocating against IDEs I use eclipse my self. I am just trying to answer his question
hhafez
On a Unix-like system (like Linux or Mac OSX), use g++. On Windows, I don't see any reason not to use VS. In Cygwin, you need to know more than just how to compile, just as you need to learn some things about VS.
David Thornley
Maybe I am assuming everyone knows the *nix environment as well as I do. Which come to think of it is a wrong assumption. But all if you already know how to use a sh/ksh/bash etc then all you need to learn is the compilation process. Which is one of the things the OP said he didn't want the IDE to hide from him. However, if he doesn't have experience with using a *nix shell of any flavor then you are 100% correct
hhafez
+9  A: 

Visual Studio (or the free version, Visual C++ Express) is a perfectly fine choice on Windows. On Linux, you'll probably end up using GCC. Both are fine compilers.

Visual C++ supports both "real" native C++ and C++/CLI, the managed .NET version, so if you want to learn C++, simply create a regular C++ project.

If you're concerned with learning "proper" standard C++, note that the compiler by default enables a number of Microsoft extensions, which you may want to disable. (Project properties -> C/C++ -> Language -> Disable Language Extensions).

For the record, GCC has similar extensions (which can be disabled by calling the compiler with --ansi), so this isn't just Microsoft being big and evil and nonstandard. ;)

jalf
nice response, very clear, thanks
flesh
+8  A: 

Visual Studio has a very good debugger. It has support for STL types (version 2008 is better) which will help you while debugging.

Visual Studio insists with the Microsoft specifics from the very first console project you make (New->Project->Win32 Console Application)

// test123.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"


int _tmain(int argc, _TCHAR* argv[])
{
    return 0;
}

What is stdafx.h? What is _tmain? What is _TCHAR? (BTW no need to answer them here) These are question which should not appear in the head of a novice.

That's why I suggest to use the "Empty project" checkbox in the Win32 Console Application project and then "Add new item" from Project menu and choose a cpp file which will give you a blank page where you can implement the code you read from a good C++ book.

Cristian Adam
A: 

I need to get up to speed with C++ quite quickly (I've never used it previously) - is learning through Visual Studio (i.e. Managed C++) going to be any use? Or will I end up learning the extensions and idiosyncracies of C++ in VS, rather then the language itself?

You should not confuse between managed C++ and VS. You can code unmanaged (true) C++ even in Visual Studio. Visual Studio is just an IDE.

If learning in VS is not recommended, what platform / IDE do you guys suggest? Edit: Can anyone elaborate on what VS will hide or manage for me when coding unmanaged C++? I really need to be learning things like pointers, garbage collection and all the nuts and bolts of the low level language.. does VS abstract or hide any of this kind of stuff from you?

VS like any other IDE will hide stuffs such as the compiling and linking stages from you. But it wont hide any language features from you. Yes you can learn pointers and other low level stuffs with VS. Unmanaged C++ does not support garbage collection. But if you are a beginner and you are not in a hurry, then the best way is to take a text editor, a compiler and a debugger and code. g++,gdb and emacs/vi will be a better substitution for VS for beginners. You will actually feel how things are compiled, linked and finally a binary is made. But it will take time and may require guidance to be up with the tools. With VS you can be up in minutes. If your objective is to learn C++ language syntax and features, then go ahead make a new empty VC++ project in VS and code.

srnayak