Sign in to follow this  
kaktusas2598

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

Recommended Posts

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.

Share this post


Link to post
Share on other sites
[quote name='kaktusas2598' timestamp='1344457228' post='4967515']
And what about C superset of C++? C standart library and etc.?
[/quote]
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.

Share this post


Link to post
Share on other sites
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 [url="http://www.cplusplus.com/"]http://www.cplusplus.com/[/url] 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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

[url="http://en.wikipedia.org/wiki/Design_Patterns"]Design Patterns: Elements of Reusable Object-Oriented Software[/url] is a great place to start.

This one is quite advanced but something I would recommend C++ programmers to eventually work towards understanding - [url="http://en.wikipedia.org/wiki/Modern_C%2B%2B_Design"]Modern C++ Design[/url]. 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.

Share this post


Link to post
Share on other sites
You should read and understand everything in the [url="http://www.parashift.com/c++-faq-lite/"]C++ FAQ Lite[/url], and for revision and more esoteric topics, read [url="http://www.gotw.ca/gotw/"]Guru of the Week[/url].

[quote name='slip' timestamp='1344466762' post='4967565']
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.
[/quote]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 ([i]as well as refining these common patterns down to their core idea[/i]). 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. Edited by Hodgman

Share this post


Link to post
Share on other sites
@Hodgman. I do agree. Some patterns do emerge and are intuitive. I certainly don't consult a book to determine which patterns to use for a given problem. Which patterns to use is something you get a feel for over time. Not everyone "thinks of" or stumbles across all patterns though, especially if they develop habits that mean they never head down a path to learn potentially more useful patterns.

Share this post


Link to post
Share on other sites
Hmm.. Does it really worth to learn all new C++11 features in order before advancing into creating games or other complexed applications? Thumbs up, though, for STL. I know it is very important in game programming and proramming in general.

Share this post


Link to post
Share on other sites
[quote name='IronyGames' timestamp='1344502137' post='4967677']
Followup question: where should I begin learning the more esoteric C++ stuff?
[/quote]

There are a few places. I would recommend checking out the C++ newsgroup comp.lang.c++.moderated (http://www.gotw.ca/resources/clcm.htm), there are always some crazy C++ topics going on in there, and I learn something everytime I read it.

Another set of books is the Essential C++ and Essential STL books, as they cover some basic things as well as overlooked things (such as the STL vector <bool> being specialized in its implementation (which is unlike the rest of the STL)).

Articles by Andrei Alexandrescu or Herb Sutter usually cover some advanced topics.

Also, if you are interested in esoteric template stuff, check out [i]template metaprogramming[/i] examples implemented in C++. (http://www.codeproject.com/Articles/3743/A-gentle-introduction-to-Template-Metaprogramming)

[quote name='kaktusas2598' timestamp='1344523019' post='4967796']
it really worth to learn all new C++11 features in order before advancing into creating games or other complexed applications?
[/quote]

IMHO no. In fact, relying on C++ 11 features may prevent you from writing good cross-platform code as it is only supported by the newest compilers, and even then it seems implementations vary widely compared to implementation of older C++ features. Also, I haven't see much code that uses C++11 features. Honestly, you're better off not using it until you really have a lot of experience in programming and game creation. I would even turn to third party libraries such as Boost first which have a lot of C++11 functionality, but at the additional benefit that it is more portable.

BTW, I have been programming in C++ for 6+ years, and I have never [i]needed[/i] C++11 type functionality. It has some really usefuly features, and I am getting into using them now mainly for specialized applications, but it certainly is not nessecary. I would never use it in open source software i would release to the publice. I would recommend getting in the habit of using smart pointers and the such, but unfortunately a lot of real production code doeesn't use these (at least that I've seen).

That's my opinion on C++ 11, but I welcome any opposing views!

Share this post


Link to post
Share on other sites
OK. So can anyone give me best resource for learning STL after I finish with general C++?
And it is worth to learn C++ file handling if I will do all file handling in QT and so on. I think SDL have its own file handling.

Share this post


Link to post
Share on other sites
[quote name='kaktusas2598' timestamp='1344543730' post='4967898']
OK. So can anyone give me best resource for learning STL after I finish with general C++?
And it is worth to learn C++ file handling if I will do all file handling in QT and so on. I think SDL have its own file handling.
[/quote]

C++ file handling is virtually identically to string console handling, so you will get that as a freebie.

I would consider picking up a book at that point personally.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this