r/learnprogramming • • 1d ago

Beginning C++ through game programming, fourth edition.

I purchased this book a few years ago. And I was wondering how viable it is for learning, and if anyone has used this book, what are your thoughts on it. I'm turning forty in november, and i'm ready to pick up a new skill i hope this book can put me on the path to that.

7 Upvotes

13 comments sorted by

5

u/SetAndRepeat 1d ago

From its contents, it looks like a reasonable starting point. It teaches fundamentals through games like Hangman and tic-tac-toe, then moves into pointers and classes. The fourth edition dates from 2014, so I'd keep LearnCpp handy for current setup instructions and modern C++ practices.

Since you already own it, try the first few chapters and do the exercises. Change the rules of each game or add a feature yourself, that's a useful check that you understand the code. And forty certainly isn't too late to learn a new skill.

1

u/lordblakwulf 1d ago

I will try this. Thank you very much

3

u/mredding 1d ago

Former game developer here,

C++ goes through revisions - 1998 was the first published standard, then again in 2003, 2011, then every three years after, 2014, 2017, 2020, 2023, and 2026.

The nice thing is each revision almost exclusively ADDS to the language, very little changes, even less gets removed. You don't break working code - and you don't break working code all the way down to the binary level, which is why removals and breaking changes are so rare.

This means it's plenty fine for you to learn from this book, even though it's likely based on the C++14 standard. 98% of any introductory material even today is going to be the same shit I learned in the 1980s. They're going to cover basic syntax, variables, functions, loops, object syntax... It's all the same. This means you can pick up a learning resource for later revisions, and you only have to learn the difference. There are online resources that lay out precisely that - the difference between 14 and 17, 17 and 20, etc... These days, you can ask AI for a comprehensive breakdown of everything between 14 and 26, if you want to feel overwhelmed...

C++14 was a small revision release for a lot of historic reasons. It didn't really add much, it mostly fixed oversights and omissions from C++11.

But understand that these introductory materials only endeavor to teach you the syntax and nothing more. You will come away knowing enough to be dangerous. It's your START. The book isn't going to teach you how to effectively USE the language - not idioms, not paradigms, not good vs. bad programming practices, not patterns, not project design and management... These are skills that take a lifetime to continually perfect.

The academic materials will sacrifice everything, including good taste, if it means teaching you the syntax in the lesson at hand. So DON'T come away thinking what you're shown demonstrated is HOW you're supposed to write software. UNFORTUNATELY, that's PRECISELY what most engineers walk away from their academics thinking exactly. So a lot of software out in the wild looks like it was written at the same level as an introductory tutorial. Or another problem that comes up is people write code like the code they're exposed to - most 3rd party code we all ever see are libraries, so a lot of code ends up looking like library code.

C++ is an industrial strength language. It leaves a lot for you to grow into. Your materials won't teach much about the standard library, but the standard library (it is NOT the STL, though people call it that - a historic screw-up that persists) is a heavyweight hitter. It does a whole hell of a lot, and a whole hell of a lot you want to do can be written in terms of it. The whole thing is A) a "common language" so you have an interface you can code to, and B) a gigantic customization point, so you don't have to accept any data structure or algorithm out of the box, you can specialize it to your needs.


I can't speak to your book specifically. What I can say is learning a language won't teach game development, a language is just a part of the whole. You'll have to also pick up calculus, linear algebra (the math of 2D and 3D), and a bit of physics. Game engines are a-plenty, but you'll have to adopt one and really understand what it does for you vs. what you have to do for yourself. DON'T seek to build your own game engine, that's a forever project. If you want to make games, there's already such a monumental list of things to do, you want to use as many utilities and libraries and things that take as much off your plate as possible.

Also find collaborators. You're probably not an artist and musician. And again - there's so much to do, you could use a friend or two. And come to r/cpp_questions for help. None of us do this on our own. And one thing you're really going to find out is just how much a computer is a machine, and how little is done for you - even if you use an engine, you've got a LOT you've got to build from near absolute scratch. A skill you'll have to develop is learning how to compound your efforts, so that the least amount of code and construction yields the most use and utility.

Learning C++ in terms of games is great - it should be way more fun than learning C++ in terms of "Hello World" and other basic text terminal nonsense, but it does add a fair amount of complexity.

1

u/lordblakwulf 1d ago

We found you're right. I am not very much of an artist. Fantastic visualizer, but not a great artist. Ironically enough, I also have a bass guitar that i'm gonna be picking up too so I can work on that artistry, part. But I like to learn and really am just looking for this to be a starting point, though, the math that you pointed out is something I will look further into. I wasn't for sure exactly which branches of math. I needed to know so thank you for that.

1

u/Dazzling_Music_2411 1d ago

Super-articulate analysis, bookmarking it!

1

u/Dazzling_Music_2411 1d ago

How did you find the book? I mean what was your opinion of it and how far into it did you get?

1

u/lordblakwulf 1d ago

I had bought it a few years ago and then I got married. And hadn't had time to really get into it, because I started a family.

→ More replies (2)

1

u/FooWho 1d ago

Making games is fun and can keep you motivated. I don't know this particular book, but it looks reasonable from the table of contents. Also, definitely checkout https://www.learncpp.com/

It is a great resource for learning C++.

1

u/lordblakwulf 1d ago

Will do thank you for the recommendation

2

u/LongStryder259 1d ago

I am not familiar with that specific book personally, but programming in general is not too difficult to learn, especially if you already know a programming language. Ultimately, there are a lot of textbooks out there that can teach you to code in any language, and they will all have their pros and cons.

What I would recommend, would be to supplement your textbook with either an additional all-encompassing text or reference book, or to use something like boot.dev. Its a website that I have had open in my browser for some time, waiting for me to have time to pursue coding again. I used to be a CS Major and switched to IT, but have always wanted to go back to programming for my own enjoyment.

That being said, C++ in my opinion is one of the best languages to start with if you are just starting out learning to code as it is a very structured language and can be used to teach you good habits. Either way, any textbook that is designed for beginners like this one should be a good starting place and can always be supplemented by other sources.