Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm learning to program in C++ from some tutorials and a book that is nearly over 1000 pages; my main intention was to do game programming. I'm self-teaching and I am at college (I'm 17) but this current course that I'm taking doesn't do programming.

It just seems that the learning curve feels very long-some. I don't know if I'm learning incorrectly or what: I have a huge book that is over 1000 pages on my lap, and it just seems quite long for me to type and copy sample code every 2 minutes. I actually want to get to a point when I can actually program something! Should the learning curve feel this long if learning a language like C++?

share|improve this question
2  
As a programmer, I noticed that being able to put code together and making a program are very different. To make a program you need a goal, then you need to plan it out, then program and stick to the goal. You need to think of something you want to make, then make that, then you will feel like you are actually programming something. The learning curve is entirely based on personal motivation. All that being said, this should be on Stack Exchange, not SO, since it is not really a question. – Sydenam Mar 26 '11 at 14:50
@Rob If you sign in to Programmers with the same OpenID that you use on StackOverflow, you will regain ownership of this question. – Anna Lear Mar 27 '11 at 0:55
What existing, open source and peer reviewed games have you looked at? – Tim Post Mar 27 '11 at 14:30
Maybe you should try to take a nice course in C++, even if its some somewhere outside your college. It would be a lot more interactive and you would learn quicker. After that you could take a book to learn the specialized game development techniques or more advanced topics – Imran Omar Bukhsh Mar 27 '11 at 14:59
@Rob: "my main intention was to do game programming" --> your goal is though. Game programming involve a lot of things: UI, 3D Graphics, Physics Engine, etc... and usually require high performance as well. That said, there are Python game engine (for example) if you want to program games without too much headaches. – Matthieu M. Mar 27 '11 at 18:23
show 1 more comment

migrated from stackoverflow.com Mar 27 '11 at 0:08

12 Answers

Thing is, C++ is a multi-purpose, multi-paradigm programming language. In C++, you have it all: High-level abstraction mechanisms such as Templates and Classes, low-level memory management mechanisms such as pointers.

In C, you don't have the high-level stuff, in Python, you don't have the low-level stuff.

Now, game programming is a very challenging field within programming, but really, C++ is the perfect language for it: Use the high-level abstractions in C++ (Classes, Inheritance, Templates) for the game logic and mechanic and the hardware level stuff for the engine.

So, with your particular language and your particular goal in mind, yes, the learning curve IS steep. As suggested before, you could start learning 'easier' languages such as Python or Java first, just to get acquainted with those concepts that are shared among almost all programming languages, i.e., what are if-statements for? How do loops work? What's the idea behind functions, arguments, return values?

Once you got these down, you can apply this general knowledge to quickly learn the basics of (almost) every other programming language.

For game developing in particular, your next step would be to understand how object orientation works in C++. Then, you need to learn how to use the graphics libraries that are popular these days, i.e. OpenGL and such. This is an entire field of its own and can be quite challenging.

Since you are still in high school, I have one further recommendation to you: Soak up as much math as possible! You need a decent understanding of linear algebra (vectors and matrices) to understand how computer graphics work.

share|improve this answer
College != high school – Cody Gray Mar 26 '11 at 15:16
1  
My bad. But even better, there's more math to pick up at college :-) – Lagerbaer Mar 26 '11 at 23:11

If C++ is your first language, then it'll take a while, since you're learning a complex subject (computer programming) and one of the most complex languages in use today. Maybe you'd want to try learning Python or Java to get the basics of programming under your belt?

share|improve this answer
2  
@downvoter: please explain. – larsmans Mar 26 '11 at 15:07
1  
c++ is as simple or as complex as you want to make it – Inverse Mar 26 '11 at 17:40
3  
@Inverse: That's a silly and meaningless statement. – Benjamin Lindley Mar 26 '11 at 17:53
@Benjamin: No. It has meaning, though Inverse has probably overstated the case. There is a great deal of complexity in C++ that a beginner can simple ignore. 'Course, it takes an expert to apportion the language in that way... – dmckee Mar 27 '11 at 0:07

Since you asked about C++ learning curve being very long here is my advice.
C++ is one of the most fascinating(called me biased), powerful & complex(not exaggeration) programming languages that is in existence today. There are so many features available in C++ that even after years and years of programming experience there is will be something new to learn just around the corner. Bottom line is Learning curve for C++ is continuous. You will learn it everyday and still there will be some more to learn the next day. There is no end to the learning curve. I would suggest you to start exploring more aspects of the language by writing programs. Writing a code is 100 times more beneficial than reading one and frankly there is no substitution to hands on on programming. Get to the point where u know how to write "Hello World" and then explore more and more with each source code you write.
All the best and wish you happy C++ programming :)

share|improve this answer

You must check this EPIC thread! Seriously.

http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list

share|improve this answer

C++ does have a long learning curve. There's a lot to learn, after all. Something that hasn't been mentioned yet is to find a mentor. Does your university have a local chapter of ACM? If you get involved with them, chances are you could find someone who is able and willing to teach you C++. I think that'll get you up to speed more quickly.

share|improve this answer

C++ has probably the longest learning curve of any mainstream language. Its learning curve is difficult for both technical and (for lack of a better word) political reasons.

On the technical side, C++ supports programming at both high and low abstraction levels. Safety and convenience features (e.g. automatic memory management via smart pointers) require explicit opt-in. The most obvious way to do something is rarely the best way. (For example, string literals are C-style char*, but the idiomatic C++ way of handling strings is to use std::string.) Because of C++'s low-level features, most high-level abstractions can be broken by a sufficiently naive or determined programmer. In languages like Java, the high-level abstractions are much less leaky.

On the political side, C++ is focused heavily on backwards compatibility and a lot of cruft has accumulated. Things like its module system (or lack thereof), its use of textual macros and certain syntax elements might be drastically improved/simplified and convenience and safety features more easily added if this constraint were relaxed. It's also designed around ANSI and ISO standards, and several competing implementations exist. None of these implement the standard perfectly, none is considered a de facto or de jure reference implementation, and the standard leaves a lot of behavior undefined or implementation defined. Therefore, code that works today on your compiler will frequently break when ported to a different compiler or compiler version. To write portable C++ code, you need to become somewhat of a language lawyer.

share|improve this answer

Yes, the learning curve for C++ is relatively high, as far as programming languages go. There are easier languages to learn, for sure, but few are as powerful. Whether or not that's important is a decision that only you can make.

The light at the end of the tunnel is that you don't have to know everything there is to know about C++ just to be able to write a useful program. Keep on slogging through, and eventually the fog will begin to lift. You might not completely understand templates and macros and multiple inheritance and all the other complicated things that give C++ its true power and versatility, but don't let that stop you. The best programmers are those that are constantly learning.

share|improve this answer

If it's game programming you are after you could take a look at the NeHe Tutorials.
The first few lessons are mostly about learning OpenGL programming in C++ but later on he moves onto many other interesting areas of game development.
I see that now most of the tutorials have been implemented in other languages also.
I find this is one of the most effective ways to learn.

share|improve this answer

It would depend on your language background; if you had a C background with an understanding in something like Gtk or NCurses (visual API state machines) then the learning curve should be fairly small. If you're starting out in programming; then yes the learning curve is going to be quite high. There are many issues when programming with statemachines such as OpenGL, DirectX, Gtk, NCurses that aren't so apparent if you've just leaned basic programming.

If you're familiar with something like Java; I would suggest trying C# with XNA as it is pretty straightforward and abstracts much of the drawing API. If you're serious about going with C++ you'll have a long road ahead of you until you learn memory management (which will probably be your biggest challenge with it).

Regardless C/C++ was my first language so I don't have much room to talk; but I would just say that it's much harder than most other languages that are out there.

share|improve this answer

In short it all depends on your exposure and experience to programming.

I've just started learning C++ also and while I have experience with C (very small amount) and other languages (mostly web based e.g. PHP, JavaScript, asp.net) I still expect that learning C++ will take a while. I have a C++ book and will be going through it. I don't expect this book to show me everything I need to know but it will be a good foundation.

There is a lot to learn in C++ so expect an uphill battle, that's what I'm doing.

Edit:

Having just read The Definitive C++ Book Guide and List, I see that my book is not well liked. I am going to continue with it as I have it but keeping in mind that it may not be following best practices for C++.

Also of note we have fdis trip report march 2011 C++ standards meeting

share|improve this answer

There are lots of C++ books, and many of them are frankly awful. Even if you have a good one it may not match your learning style. I recommend you look for a book (or an online course, or a series of videos) specifically on game programming in C++. When you run into a piece of code you can't understand (because it assumes some specific C++ background), look that thing up in your thousand page book. This approach should get you doing something sooner rather than reading all the background before you can even start.

share|improve this answer

For any language I would suggest this approach :

  • Do the hello world.. this is nothing as thrilling as seeing your code - no matter how trivial - actually do something. At worst you feel like you are making progress +1 to motivation

  • Step back and get the 50 000 foot view and break the new domain up in as clean a separations as possible.

At the heart of every domain is a small kernel or domain knowledge required. People extend that kernel and add layer upon layer to it, so increasing the domain knowledge surface area to the point that you just cannot know it all.

Once you have the kernel grounding everything else is just a precept upon a precept in the direction you are exploring.

C++ the 50 000 foot view

  • The language syntax - the simple control statements
  • It is Object Oriented - learn how to create classes and what that means

Now all of this is platform agnositc. Then time to think about your platform and problem domain

  • Find the Appropriate API and learn that.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.