Jump to content

  • Log In with Google      Sign In   
  • Create Account


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


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
14 replies to this topic

#1 kaktusas2598   Members   -  Reputation: 835

Like
3Likes
Like

Posted 08 August 2012 - 01:32 PM

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.
Behind every great fortune lies a great crime.
Honore de Balzac

Sponsor:

#2 Serapth   Crossbones+   -  Reputation: 5263

Like
9Likes
Like

Posted 08 August 2012 - 01:43 PM

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.

Edited by Serapth, 08 August 2012 - 01:46 PM.


#3 kaktusas2598   Members   -  Reputation: 835

Like
0Likes
Like

Posted 08 August 2012 - 02:20 PM

And what about C superset of C++? C standart library and etc.?
Behind every great fortune lies a great crime.
Honore de Balzac

#4 frob   Moderators   -  Reputation: 19820

Like
4Likes
Like

Posted 08 August 2012 - 02:25 PM

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.
Check out my personal indie blog at bryanwagstaff.com.

#5 kaktusas2598   Members   -  Reputation: 835

Like
0Likes
Like

Posted 08 August 2012 - 03:12 PM

Thanks, to both of you. :)
Behind every great fortune lies a great crime.
Honore de Balzac

#6 scyfris   Members   -  Reputation: 168

Like
4Likes
Like

Posted 08 August 2012 - 03:13 PM

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.

#7 dimitri.adamou   Members   -  Reputation: 329

Like
1Likes
Like

Posted 08 August 2012 - 04:34 PM

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

#8 slip   Members   -  Reputation: 140

Like
4Likes
Like

Posted 08 August 2012 - 04:59 PM

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

#9 IronyGames   Members   -  Reputation: 134

Like
0Likes
Like

Posted 09 August 2012 - 02:48 AM

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?

#10 Hodgman   Moderators   -  Reputation: 28614

Like
2Likes
Like

Posted 09 August 2012 - 03:02 AM

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.

Edited by Hodgman, 09 August 2012 - 03:07 AM.


#11 slip   Members   -  Reputation: 140

Like
0Likes
Like

Posted 09 August 2012 - 05:30 AM

@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.
www.ice-d.com

#12 kaktusas2598   Members   -  Reputation: 835

Like
0Likes
Like

Posted 09 August 2012 - 08:36 AM

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.
Behind every great fortune lies a great crime.
Honore de Balzac

#13 scyfris   Members   -  Reputation: 168

Like
1Likes
Like

Posted 09 August 2012 - 10:39 AM

Followup question: where should I begin learning the more esoteric C++ stuff?


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 template metaprogramming examples implemented in C++. (http://www.codeproject.com/Articles/3743/A-gentle-introduction-to-Template-Metaprogramming)

it really worth to learn all new C++11 features in order before advancing into creating games or other complexed applications?


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 needed 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!

#14 kaktusas2598   Members   -  Reputation: 835

Like
0Likes
Like

Posted 09 August 2012 - 02:22 PM

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.
Behind every great fortune lies a great crime.
Honore de Balzac

#15 Serapth   Crossbones+   -  Reputation: 5263

Like
0Likes
Like

Posted 09 August 2012 - 03:52 PM

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.


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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS