How do I learn C++

Associate
Joined
13 Feb 2010
Posts
944
If anyone has any experience with learning C++, how did you do it (Books for e.g). Also how long did it take, to start getting the hang of things, and knowing a decent amount.
 
Best way of learning any language is to have a small project and make it in that language. C++ is not a recommended first language.
 
Best way of learning any language is to have a small project and make it in that language. C++ is not a recommended first language.

This.

I've jumped in at the thick end with C++ using something called openFrameworks. I find that with it's visual association it really helps and you can "see" what the result of your code is visually, which really has helped me in the last few days. Managed to get a small Terraria style game going from it. Although it's highly ineffective with just a tone of <vectors> plonked randomly everywhere.
 
I would recommend looking for a good book. You should start out with a easier language like PHP or Python first.
 
Book worked for me, and it was my first programming language. It took a couple months to really learn the base language, STL, OO etc. the more advanced topics come with time and necessity. Start with a basic book if you have no programming experience, and then when you have an idea of what you're doing start reading the great books such as Exceptional C++. Fantastic read for someone learning C++.

Learning other languages from then on was a breeze. You could start with a simpler, higher level language such as Python if you like, but it's down to what you want to do with the knowledge imho. :)
 
C++ is not a recommended first language.

Why? Yes it is considered one of, if not the most difficult language that is in mainstream use but if you can get a good grasp of this most other languages are then a piece of pee to learn!

Definitely worth the little bit of extra hard work.
 
Possibly because C++ is described as C (which has its own issues) with object orientation hacked on at a later date. Either C or a friendly language would seem to be more sensible.

I'd agree with sldsmkd. The most success I've had so far has been finding something I want to do, such as solve suduku or parse html, and then get the program to do roughly what I wanted. Setting out to learn a language caused me problems with general lack of focus, whereas setting out to reformat a dynamic webpage with awk has left me with working code and a sort of accidental understanding of the scripting language.
 
I wouldn't recommend learning c as it doesn't teach you the most important modern programming paradigms.

If anyone has any experience with learning C++, how did you do it (Books for e.g).

By book. C++ was the first language I learned and I definitely think that learning it first was the best decision I made. Yes the learning curve is steep but once you've learnt c++* other languages are easy.

I also wouldn't recommend diving into a project straight away as you'll "learn" things too quickly and incorrectly which will leave you with bad habits!

The book I recommend to people is accelerated c++. Read that once through, then once again and you'll be in a great position to start programming decent code.

Also how long did it take, to start getting the hang of things, and knowing a decent amount.

I would say it took me a year or so to be able to write ok code, I am entirely self taught and from knowing almost nothing about programming 2 years ago I now work in the video games industry working on a game engine in c++. How long it would take you to get up to speed will depend on your dedication, amount of free time, and intelligence. One thing to remember though is that you never, ever stop learning.

Good luck! :)

*it must be said though that you never actually stop learning c++ but I have a decent grasp of it ;)
 
Last edited:
What makes you want to learn C++ then, OP?

(I know little of such things really but I was under the impression that C# was the way to go now?)
 
Get a book, mate. The two volume free book Thinking in C++ is a well regarded tutorial and goes into slightly more detail than Accelerated C++ mentioned above. As for time scales, it chiefly comes down to how new you are to programming, the time you have to spend on learning the language and the level of competence you are aiming for. :)

If you are a beginner, take as much time as is necessary to master the key concepts - it will pay dividends in the long term.
 
Personally I learnt C first, at Uni. Did have one C++ module but 90% of the course was C and I enjoyed a whole lot more. Then I did Python very briefly which IMO is the best way of learning the OO part, then smushed that together with my C knowledge whilst learning C++!

C > Python > C++ is IMO a good path to take.
 
Thanks for all responses so far, I'v been learning python so far taught by Rich43, and he has taught me a lot already, and really enjoying it, not sure when but I will hopefully learn C++, and im sure my knowledge from python will help me :)
 
I started on C++, Only programming knowledge i had was from basic on the Amiga & Earlier commodore systems. I got a few C++ books which i found easier to learn from rather than reading them on a computer mainly because its quick to find reference to things.

I only started on C++ because i always heard people talking about how all the "pro" devs use it to make games etc, But now with about a years programming learning i think i should have started with Java, Much of what i learnt in C++ i could take to java, So it wasnt a total waste.

I also tried C# which i actually find a very good language & i like XNA for some simple game stuff, But i do find myself a little frustrated at being able to only deploy on windows machines Rather than anything with a JVM.

I think whatever you learn first there is no "wrong" or "right" once you learn some concepts & how to control the flow of a program you can take all that with you to another language.

Coming back to your main question i think everyone is different on how long it takes to learn, For me i feel very beginner still now & i been learning for about a year but not full time, I come and go at it when i feel like it.

I had C++ In easy steps & C++ A beginners guide to start with, Found both pretty good. Also if you after doing some C# I recommend Head first C#.

Good luck
 
Learning it myself with Accelerated C++, was planning to just go through it and work on the tutorials whilst also having some of my own projects on the go as well. After that I'm just going to try and get involved in some open source stuff or atleast try and understand their code. Guessing this is the normal route for people as it is hard to know where to go after learning the basics.
 
Back
Top Bottom