Topics to master in C++ before advandce to next level

Started by
13 comments, last by Serapth 11 years, 8 months ago
Okay, I came back to programming after year pause. My language of choise was and is C++ and I'm relearning it now. My question is really silly. So here it goes: Is there a list of topics in programming language (C++) I need to know before advancing into creating more sophisticated applications like games and so on. I mean topics like functions, pointers and etc. Can somebody give me this list. I'm looking forward to dive into things like Qt, SDL (actually knew it in past, but forgot) and maybe OpenGL.

Deltron Zero and Automator.

Advertisement
All of it.


Well, that's not really a helpful answer, but you want to pick up as much as you can, beyond going into the esoteric stuff ( which C++ is full of ).

To start you should master:
variables and scope ( learn the difference between a local and global )
program flow ( if, while, for )
console and string ( string/iostream )

Next you should conquer:
functions
passing by value vs reference
splitting code into multiple files ( header, cpp, include guards/pragma once )

Then move on to:
objects/classes
inheritence
member functions/variables

Then:
smart pointers
STL containers ( start with vector )

Then:
Dealing with the linker, consume a 3rd party library like SFML or SDL

At this point you are probably ready. Optionally look into new/delete/manual memory management at this point. You should probably look into exception handling at this point as well.

I have a tutorial linked in my sig that might help you, once you have completed at least the first part of this list.
And what about C superset of C++? C standart library and etc.?

Deltron Zero and Automator.


And what about C superset of C++? C standart library and etc.?

They diverged shortly after C++ was created, the language is not a superset.

Standard C89 did not compile in the nascent C++ compilers of the era, and they have diverged further since. Non-trivial C programs do not compile in a C++ compiler, nor do non-trivial C++ programs get through C compilers.


That said:

You don't need to bother with the C standard library, although nothing is stopping you if you want to learn it.
Thanks, to both of you. :)

Deltron Zero and Automator.

The best to REALLY learn a language is to just dive in, study other people's code (check out some open source game engines, or even games), and start programmin your own game. Even if you have to start from a "Hello, World" example and build games from there, JUST WRITE GAMES ( which also means you are writing code). IMHO, game programming is one of the best ways to learn various programming paradigms in general. Programming a complete (albeit simple) game engine (don't start off there) will make you use many patterns in design which can be translated to ANY language, but more importantly you will gain an understanding about how these patterns are designed using the language of your choice (in your case, C++). I would also add http://www.cplusplus.com/ is a great resource for exploring C++ language features as well as various STL and C standard libraries. Also, if you are really wanting to target C++, I would suggest learning and using templates early on as they are a very powerful feature of C++ which C does not have. Many libraries (in particular Boost and QT) will take advantage of templates in their designs (STL stands for Standard Template Library, and templates are the basis behind their design, so even if you are just using templates and not designing class or function templates yourself, it still comes in handy to know what they do and how they work).

Also as a side note, OpenGL's interface and API is in C, not C++. Although C++ may not be a strict superset of C, they play very well together, and you can certainly call C library functions from within your own C++ code.
I think a majority of it actually has to do with learning how to program, skills that you can take from 1 language into another, but with regards to C++, you will want to learn and udnerstand

STL - Its a big part of C++ (or you could be brave and do it all alone); containers, iterators, strings, regular expressions, streams
Memory Management (including Smart Pointers)
C++11 features (move semantics, use of lambda expressions, Initializer lists ... I can't even remember them all anymore lol)
Templates
Multithreading

And just work on building up your design, theres alot of different paradigms out there
Something that is often overlooked by people learning to program is the importance of design patterns. Design patterns aren't about how to write code in a particular language but rather how to structure code and make it as flexible and robust as possible.

Design Patterns: Elements of Reusable Object-Oriented Software is a great place to start.

This one is quite advanced but something I would recommend C++ programmers to eventually work towards understanding - Modern C++ Design. It makes heavy use of templates.

These are just two examples of great books on the topic. I can't stress enough how important software design is for programmers. Simply learning how to write code might allow you to hack things together, but projects that have a high level of complexity (and games certainly fits in this category) are almost impossible to maintain if not designed properly.

It was years before I was made aware of design patterns, after which my programming ability improved dramatically.
www.ice-d.com
Must say, thanks to everyone as I am kind of in the place of OP as well.

Followup question: where should I begin learning the more esoteric C++ stuff?
You should read and understand everything in the C++ FAQ Lite, and for revision and more esoteric topics, read Guru of the Week.


Something that is often overlooked by people learning to program is the importance of design patterns. Design patterns aren't about how to write code in a particular language but rather how to structure code and make it as flexible and robust as possible.
I'd say they're more about just giving names to common patterns that seem to be re-invented over and over again, to make conversing with other programmers and explaining your code easier (as well as refining these common patterns down to their core idea). They shouldn't be used as a "play book" of designs, though yes, they can be a good learning resource if you've never seen a certain pattern used before.

This topic is closed to new replies.

Advertisement