I recently decided to start learning a second language now that I'm quite comfortable with Java. I'm just looking for a few opinions on which ide to use, what I'm looking for is something that's free, or 'free,' that is well documented/used in a lot of tutorials.

I feel like the ide will have a bigger impact when learning c++ than it did when I was learning Java as I'll be using features other than the text editor much more often(correct me if I'm wrong), so I'm looking for something that is widely used and therefore easier to google anything I might need to find out about it.

I'm familiar with eclipse using Java, I'm not sure how good it is for c++ I know it's an option though. Just from googling around I see a lot of people who love VS but also a small subset of people who absolutely hate it. Also I don't know how hard it'd be to get without spending hundreds of dollars/how good the express edition is.

What would you recommend for someone who wants to learn c++ and eventually use it for much more complex programming?

for the record; I love intellisense, and I'm using windows 7 on a reasonably fast computer

EDIT:this is my reply I posted further down, I just wanted to include it here so more people see it because I'd like to get some more feedback on it but it doesn't really warrant a new thread.

Thanks for all the great replies everyone! I think I'm going with Visual studio 2012 express(is there any reason that I might use 2010 instead?). I tried a few tutorials already just using visual c++ express cause apparently I already had it, but it always got build errors. just from simple hello world programs. I'm assuming It's something to do with my setup because i tried several tutorials copying the code exactly and they all got the same error. even the default hello world program errored. hopefully I wont have that issue in VS

I would recommend not using an IDE at first, actually. Using a toolchain of separate tools (initially this can be just text editor and compiler, with build control, memory analyzer, static analyzer, debugger added into the mix later one by one) lets you learn faster what is going on. Also, while you have a small amount of code, like just a couple of thousand or ten thousand lines, I don't see an IDE actually doing anything for you over separate tools.

Hmmm. that actually sounds like a good idea, my main goal here is to learn everything thoroughly and properly from the beginning so I can be a good c++ programmer soon. I think forcing myself to do that will help me learn things that I'd usually just happily ignore and let my IDE do it for me. How important and how hard is learning all that? Anyone else think this is a good idea?Also while I'm here, should I start with c++ 11? I know nothing about the different versions, is it backwards compatible? is it or will it be the standard soon? which version do you recommend I start with and why? The only concern I might have about that is that its new and might not be as well documented, I love have a wealth of resources when learning something new and complicated like c++.Anyone have any other general suggestions for learning resources or tips? I wanna learn this as thoroughly and as well as possible but I'm also eager to get my hands dirty with some real programming as soon as I can

I'm just looking for a few opinions on which ide to use, what I'm looking for is something that's free, or 'free,' that is well documented/used in a lot of tutorials.

The most popular free IDEs for C++ are probably, in no particular order, Visual C++ Express, Code::Blocks and Qt Creator.

I feel like the ide will have a bigger impact when learning c++ than it did when I was learning Java

Perhaps. For Java, an IDE as pretty-much mandatory though, as the build process is difficult to manage without one. In C++, it's doable (though non-trivial) without using an IDE.

I'm familiar with eclipse using Java, I'm not sure how good it is for c++ I know it's an option though.

I only tried the Eclipse CDT plugin ~5 years ago. It was awful then (too slow to be useful), but it might have improved by now. You could of course take a look at a recent version if you're sufficiently attached to eclipse.

Just from googling around I see a lot of people who love VS but also a small subset of people who absolutely hate it.

I'm one of the people that hate it (though I like the Visual C++ toolchain). Vim has spoilt me.

Also I don't know how hard it'd be to get without spending hundreds of dollars/how good the express edition is.

The express edition is probably fine. It certainly won't hurt for starters.

I will say though, that regardless of the IDE you pick, it's absolutely essential, IMHO, that you get to grips with the C++ compilation model early on. Once you understand this, you'll be able to fix your own problems easily, regardless of which IDE you pick.

What would you recommend for someone who wants to learn c++ and eventually use it for much more complex programming?

I would recommend not using an IDE at first, actually. Using a toolchain of separate tools (initially this can be just text editor and compiler, with build control, memory analyzer, static analyzer, debugger added into the mix later one by one) lets you learn faster what is going on. Also, while you have a small amount of code, like just a couple of thousand or ten thousand lines, I don't see an IDE actually doing anything for you over separate tools.

Brace yourself for the horrors of memory management. That is all.
However in all seriousness, some pointers:

1) C++ Is Unforgiving. Your code's errors can be extremely weird.
Example:
I had my Breakout game. In debug mode everything worked fine, however in release mode whenever the cursor crossed a certain Y position on the screen the game would just close. I eventually found out that I had an undefined Boolean value that I was referencing in a Class. The bug was annoying because it was working fine on my machine, which made pinpointing the error extremely annoying. And of course, the IDE in debug mode didn't give me the error (Or even a warning message).

2) Memory Management Tips
First Tip: Delete dynamically allocated memory as soon as possible. Whenever you do, set the pointer to null.
Also, try to use the new operator as little as possible. Using auto-pointers is fine, and you generally don't need the normal new and delete operators.

Also, I use Visual Studio, however there are many good IDE's. The debugger in Visual Studio is amazing.
I've used Code::Blocks. It doesn't have precompiled headers and the library support is good, however a lot of the auto-linking libraries don't work (SFML 1.6, as of now, doesn't work correctly).

It really doesn't matter which IDE you use. Just try them all out and see which one you like.

And of course, the IDE in debug mode didn't give me the error (Or even a warning message).

The reason is because it is not a warning or error to the language. Also this is a big reason that you should use initializer lists in all constructors to initialize the class members, or in the rare case that you don't (say in a vector4 or matrix44) you need to be careful never to use it until it has been assigned a value. Note the reason it works fine in debug mode is that values will be initialized whereas in release mode they are not.

First Tip: Delete dynamically allocated memory as soon as possible. Whenever you do, set the pointer to null.

I disagree with both. It is actually much better to reuse dynamically allocated memory at runtime than to delete and reacquire. I would only delete when it is no longer needed. Although this is really a non-issue if you are using C++11 due to having std::unique_ptr, std::shared_ptr, and std::weak_ptr.

Regarding setting the pointer to null after deletion this is something I absolutely disagree with and is just inviting bugs to linger in your codebase. By setting to null you won't catch any double delete errors, etc which would be found and handled easily by attempted to delete something that has already been deallocated.

Regarding setting the pointer to null after deletion this is something I absolutely disagree with and is just inviting bugs to linger in your codebase. By setting to null you won't catch any double delete errors, etc which would be found and handled easily by attempted to delete something that has already been deallocated.

This is something that is important in C so many C programmers carry this habit over to C++.

As you're coming from eclipse i would recommend Code::Blocks and Netbeans. Eclipse CDT is ok,
but I don't like it's gdb integration. It doesn't keep the hook properly, and that makes threading even more of a pain.
Both Netbeans and Code::Blocks are fairly lightweight. VS is great too, but for small projects like mine, VS just seems too heavy.

Thanks for all the great replies everyone! I think I'm going with Visual studio 2012 express(is there any reason that I might use 2010 instead?). I tried a few tutorials already just using visual c++ express cause apparently I already had it, but it always got build errors. just from simple hello world programs. I'm assuming It's something to do with my setup because i tried several tutorials copying the code exactly and they all got the same error. even the default hello world program errored. hopefully I wont have that issue in VS

I would recommend not using an IDE at first, actually. Using a toolchain of separate tools (initially this can be just text editor and compiler, with build control, memory analyzer, static analyzer, debugger added into the mix later one by one) lets you learn faster what is going on. Also, while you have a small amount of code, like just a couple of thousand or ten thousand lines, I don't see an IDE actually doing anything for you over separate tools.

Hmmm. that actually sounds like a good idea, my main goal here is to learn everything thoroughly and properly from the beginning so I can be a good c++ programmer soon. I think forcing myself to do that will help me learn things that I'd usually just happily ignore and let my IDE do it for me. How important and how hard is learning all that? Anyone else think this is a good idea?

Also while I'm here, should I start with c++ 11? I know nothing about the different versions, is it backwards compatible? is it or will it be the standard soon? which version do you recommend I start with and why? The only concern I might have about that is that its new and might not be as well documented, I love have a wealth of resources when learning something new and complicated like c++.

Anyone have any other general suggestions for learning resources or tips? I wanna learn this as thoroughly and as well as possible but I'm also eager to get my hands dirty with some real programming as soon as I can

Hmmm. that actually sounds like a good idea, my main goal here is to learn everything thoroughly and properly from the beginning so I can be a good c++ programmer soon. I think forcing myself to do that will help me learn things that I'd usually just happily ignore and let my IDE do it for me. How important and how hard is learning all that? Anyone else think this is a good idea?

A command-line compiler is a great tool to learn. You will use it at some point in your career, and I'd recommend using that over an IDE at this point in time. IDE like VS can spout out error because of IDE config errors, not your code. This can confuse beginners a lot, thinking that their code is wrong while in fact, the IDE is messed up.

Also while I'm here, should I start with c++ 11? I know nothing about the different versions, is it backwards compatible? is it or will it be the standard soon? which version do you recommend I start with and why? The only concern I might have about that is that its new and might not be as well documented, I love have a wealth of resources when learning something new and complicated like c++.

I don't know much about C++ 11, but last time I tried to use it, the compilers have yet fully support all the features of C++ 11. You will get different results depending on which compiler/IDE you use (GNU, VS). I would suggest that you stay away from it for now. It's an extension of the language, not a whole redesign, so you won't miss a thing.

Anyone have any other general suggestions for learning resources or tips? I wanna learn this as thoroughly and as well as possible but I'm also eager to get my hands dirty with some real programming as soon as I can

I would focus on pointers, ctors, and dtors, as that's one of the main differences between Java and C++. When objects are allocated/deallocated in C++ is a whole different thing.

Also while I'm here, should I start with c++ 11? I know nothing about the different versions, is it backwards compatible? is it or will it be the standard soon? which version do you recommend I start with and why? The only concern I might have about that is that its new and might not be as well documented, I love have a wealth of resources when learning something new and complicated like c++.

It's "backwards compatible" in the sense that pretty much all older C++ code is valid C++11 code as well.I would say yes, use C++11 features as much as your compiler of choice supports. It makes the code more readable, more compact and more efficient. GCC as well as Microsoft's compiler both have decently wide support and are constantly getting more. Clang is getting there too, but slower.

ah I see, I was confused about c++ 11 thanks for clearing that up. I'll definitely just stick to 'regular' c++. I'm gonna download a compiler and just get started with that and notepad, does it matter much which compiler I use? Which would you guys recommend I'm just looking for something popular and standard. I didnt look into compilers much yet so sorry if that's a stupid question

I like g++, but I am not sure how people normally use it under Windows (I have used it under Linux, Solaris and Mac OS/X).

About memory management:
* Don't do your own dynamic memory allocation: Use local variables and standard containers instead.
* If you really need dynamic memory allocation, use a smart pointer like std::shared_ptr.

If you feel tempted to use `new' (which I know is a common tendency in Java programmers), resist your urge. You probably don't need it. If you can't figure out how to avoid it, post here and we'll probably be able to help.

I like g++, but I am not sure how people normally use it under Windows (I have used it under Linux, Solaris and Mac OS/X).

About memory management: * Don't do your own dynamic memory allocation: Use local variables and standard containers instead. * If you really need dynamic memory allocation, use a smart pointer like std::shared_ptr.

If you feel tempted to use `new' (which I know is a common tendency in Java programmers), resist your urge. You probably don't need it. If you can't figure out how to avoid it, post here and we'll probably be able to help.

I can tell this is gonna be fun already lol, it is surprisingly hard to google how to use c++ without a compiler. I tried winging it, I wrote a hello world in notepad and saved it as hello.cpp, navigated to the directory in command prompt and typed the command i finally found on google (c++ hello.cpp -o hello.exe) and I get an error saying 'c++' isn't a recognized command, so I'm assuming I have some more setup to do with my compiler(using the c++ compiler i downloaded with the microsoft sdk) in order for it to recognize the command. Can anyone help me or tell me what to google, I'm having trouble getting results related to my problem, just a bunch of stackexchanges about much more complicated questions than mine, ill be searching in the meantime.

EDIT: forget all my edits, I found the path to the VC compiler by running the VC command prompt, it's the default path for it.

Thanks again for all the help everybody

I like g++, but I am not sure how people normally use it under Windows (I have used it under Linux, Solaris and Mac OS/X).

About memory management:* Don't do your own dynamic memory allocation: Use local variables and standard containers instead.* If you really need dynamic memory allocation, use a smart pointer like std::shared_ptr.

If you feel tempted to use `new' (which I know is a common tendency in Java programmers), resist your urge. You probably don't need it. If you can't figure out how to avoid it, post here and we'll probably be able to help.

thanks, I probably would have been using 'new' like crazy haha. These are the kind of tips I need

First, I reiterate you'll definitely want to use C++11, even more so if you want to keep things 'regular'. If you try to keep your code conforming to the ancient C++98 standard, you'll need to use much more nonstandard libraries like Boost to accomplish basic things that in C++11 are in the standard library, and there's really no reason to do that.

The tools you get in MinGW are the most standard, best documented stuff you can find. Initially you just need to use the gcc compiler, but you'll also have the gdb debugger and make build tool waiting for you for later.
With gcc installed, you'll want to use
g++ -Wall -Wextra -std=c++11 -o hello.exe hello.cpp
to compile your Hello World. If the gcc is slightly older version, you'll need to use -std=c++0x instead of -std=c++11.

As for editors, Notepad is terrible. At the least, use Notepad++ or equivalent. The heavy hitters, Vim (my favorite) and Emacs are great but take some learning to use. Sublime Text is both easy and powerful, but is only free for evaluation, and continued use requires buying a license. The license is cheap, though.

I recommend, assuming you're on Windows, NetBeans/C++ on MinGW. Eclipse/CDT is more professional, but NetBeans is just friendlier for beginners.MinGW is the Windows implementation of GCC. You can get vanilla MinGW or The Dragon MinGW which supports x64. GCC which is currently the de facto compiler of choice for *nix users, though LLVM is starting to come up strong.For the (mostly) complete *nix experience, I'd get the MSYS setup available from the main MinGW distribution. Your new favorite phrase will become[source lang="bash"]./configure --prefix=/mingw && make && make install[/source]For a complete MinGW setup, I'd check out this site: (Warning: LENGTHY, BUT WORTH IT.)http://ingar.satgnu....gw32/index.html

Moving from Java though, as stated above, the biggest issues is memory management. Every object you allocate NEEDS to be deleted. Pointers go hand in hand with this one. Are you sending to a pointer to an object or a pointer to a pointer to an object? This will become important later on in your explorations.For leaks, I found this, but haven't gotten around to using it (I tend to do things by hand - and consequently rarely get things done.)MPatrol (Setup for MinGW)

As for libraries, the best things in life are free, or so I've been told.For standard everything but the kitchen sink library needs, the Boost Libraries will cure what ails you.SDL is the game library everyone starts with. (You'll also want SDLImage, SDLNet, and SDLMixer.)SFML is an excellent "next-step" game library.For pure 3D, you've got Irrlicht and Ogre3D.

Hmmm. that actually sounds like a good idea, my main goal here is to learn everything thoroughly and properly from the beginning so I can be a good c++ programmer soon. I think forcing myself to do that will help me learn things that I'd usually just happily ignore and let my IDE do it for me. How important and how hard is learning all that? Anyone else think this is a good idea?

A command-line compiler is a great tool to learn. You will use it at some point in your career, and I'd recommend using that over an IDE at this point in time. IDE like VS can spout out error because of IDE config errors, not your code. This can confuse beginners a lot, thinking that their code is wrong while in fact, the IDE is messed up.

I disagree. Do you want to learn the language or the toolchain? If you're learning a language, the error is far more likely to be in your code than the IDE config. The same cannot be said of command line compilers. I'm not saying they're not a useful tool, but I don't feel they're helpful for beginners.

Regarding setting the pointer to null after deletion this is something I absolutely disagree with and is just inviting bugs to linger in your codebase. By setting to null you won't catch any double delete errors, etc which would be found and handled easily by attempted to delete something that has already been deallocated.

I disagree with your disagreement Deleting an object doesn't necessarily overwrite the memory. It's quite common for code like this to work

If you set the pointer to null, this will blow up (a Good Thing). If not, then you have an intermittent runtime problem that's a nightmare to debug. I'd argue that's a more serious error than a double deletion, as deleting a null pointer is officially safe.

Of course, as you said, you should really be using smart pointers and avoid the whole mess anyway!

if you think programming is like sex, you probably haven't done much of either.-------------- - capn_midnight

If you set the pointer to null, this will blow up (a Good Thing™). If not, then you have an intermittent runtime problem that's a nightmare to debug. I'd argue that's a more serious error than a double deletion, as deleting a null pointer is officially safe.

I think the point is that it's a very good idea to ensure that cleanup of a resource (e.g. deletion) coincides with the lifetime of the handle to that resource. So, there shouldn't even be a pointer to dereference once the resource's destructor has been called and memory deallocated e.g.

{
scoped_ptr<X> px(new X); // or shared_ptr/unique_ptr/...
// ...
}
// Can't even use px here because the lifetime of the resource is bound to the lifetime of an object.
// Access to a deleted object via a dangling pointer is impossible.

In other words, if there's an opportunity to ensure you're doing something that's correct-by-construction, rather than correct-by-convention, take it.

Somewhat more on topic, I have a lot of sympathy for the suggestion that you start without an IDE. It will certainly help you understand C++'s compilation model sooner, which as I said is a good thing for diagnosing build problems. But I personally might not go so far as to recommend an IDE-less approach, initially.