How Does One Learn C++ ?

Started by
15 comments, last by LorenzoGatti 7 years, 1 month ago

Proceed trying getting result, dont learn stuff what you can look up.

What you do with it you can fill in yourself, no one learning you, else you could look it up.

Ask someone who knows if you have problems so you can proceed with having results, forum dont always react, or getting weird discussions like learn first before you ask.

Thats how i think, dont wanto start arguements or fights, keep it nice please.

S T O P C R I M E !

Visual Pro 2005 C++ DX9 Cubase VST 3.70 Working on : LevelContainer class & LevelEditor

Advertisement
I really like this online book http://www.icce.rug.nl/documents/cplusplus/

I am self-taught in C++ - it is not easy. One thing that really helps is to understand the fundamentals of how computers work. Because C++ is a lower-level language than some other more modern languages (not as low a level as assembler or machine code, but lower than, say, Java), one has to engage with how computers actually work in order to use it. Understanding things like the difference between the heap and the stack, how computers address memory and what happens when you delete an object from memory will help enormously in understanding why some things work and some things do not.

Also, if you have no experience of object-oriented languages, you will need to learn about the fundamentals of those, too, as this can be confusing without a good introduction to the concepts.

When I began learning I thought TheNewBoston, a YouTube channel, had a pretty easy to understand tutorial series on C++. It was at a simple enough level that I was able to understand how the language worked.

After learning from a simple source, I moved on to more thorough explanations. ChiliTomatoNoodle, another YouTube channel, is the next source I used to learn C++. He has some really good C++/DirectX game programming series.

Currently, I am going through the Handmade Hero series on YouTube. This person seems to be at the level of knowledge for general programming and game programming that I am trying to reach.

It's like digging a hole. Or going to a buffet. Just dig in.

@tomd1013

Do practice a lot too. Watching a video seems a useful way to learn (and it is), but actually doing it, solving your own problems and toying with them, ie hands-on experience from your own problems that you solve, makes that knowledge stick and truly becoming your own knowledge.

I find a lot of the confusion people have (based on seeing the C++ questions in this and other forums - such as a recent one about returning references to parameters from a function) comes from not understanding what's going on under the covers. For this, some low-level knowledge is definitely useful. I dunno if learning C first makes sense - but at least when learning c++, it seems it would be useful to make sure you understand exactly how memory is being copied or manipulated when learning about a specific feature.

Understanding concepts like pointers, function calls, memory allocation etc. relies on "under the covers" CPU and operating system concepts that can be learned by themselves and put in context as the way a C++ program actually works. Learning basic general concepts from the point of view of C first has bad effects:

  • Thinking that anything in C++ that diverges from C or is more complex is gratuitously different, without understanding the reasons, so why use it? For example, printf can print anything without silly streams and templates, I don't need to learn streams and templates to be a productive "C++" programmer..
  • Thinking that high level, expressive C++ features are fancy and unnecessary, with their avoidance compromising other features and code quality in a cascade of backwardness. For example malloc instead of new: it doesn't crash, and exceptions are unlikely if I don't throw them.
  • Thinking that a C++ program can get away with a number of little things that are only allowed in C.

The bad attitude towards C++ and its toxic relationship with C are being perpetuated from the very beginning of C++, when Stroustroup had to "sell" an improved programming language to expert C programmers for which C++ couldn't be anything else than a fancy, semi-experimental second language.

Omae Wa Mou Shindeiru

This topic is closed to new replies.

Advertisement