r/cpp • • Apr 23 '16

Just started coding with C++

I just started coding with C++ not too long ago, but I've had alot of experience with other coding languages (Java, Javascript, HTML, Python.) But if I'm aiming to make games with C++ one day (After years and years of practice of course) what do I need to learn? What books do you recommend? What exercises should I practice? As far as I know there's no website to 'teach' the subject (Like CodeAcademy and what not), so what would you recommend to get me started?

1 Upvotes

32 comments sorted by

View all comments

8

u/_lerp Apr 23 '16

Effective Modern C++ by Scott Meyers

and IMO the thing that sets C++ apart is the metaprogramming, i.e. templates.

17

u/lex99 Apr 23 '16

I strongly disagree with advising newcomers to learn metaprogramming. It's the most advanced aspect of C++, hard to follow, write, and debug. You can go far in c++ without it.

I would instead advise the newcomer that c++ gives you total control of your system (modulo the compiler) and with it you can really understand how every action the computer takes is due to some value at a specific location in memory being operated on, or some system call being executed, and there's NO magic anywhere. For folks that came up in Python, ruby, JS, etc, there's a large abstraction between the code and the machine.

-1

u/flyingcaribou Apr 23 '16

I would instead advise the newcomer that c++ gives you total control of your system (modulo the compiler) and with it you can really understand how every action the computer takes is due to some value at a specific location in memory being operated on, or some system call being executed, and there's NO magic anywhere. For folks that came up in Python, ruby, JS, etc, there's a large abstraction between the code and the machine.

Why not just do C, then?

1

u/lex99 Apr 24 '16

I'm saying metaprogrammer is too out there, hard to do, and unnecessary, for a new C++ to aim to learn. I don't think it's THE reason one would use c++.

But even without metaprogramming, C++ has lots of critical improvements over C.

I wasn't saying though "pick the absolute least-magical lang."