Part 2 of Learning how to build a game in C++
I choose C++ because I know a little about it and want to know more, especially with the recent changes to the standard with C++11 and C++14. The manual memory management seems well suited for the high performance requirements of displaying graphics and performing physics calculations. Another plus point for C++ is that is has good compilers on every platform and can be used in iOS and Android apps.
While I’m sure whatever I produce shouldn’t really be taxing in terms of memory, one of my incidental goals is to gain a better understanding of memory management as I rely on garbage collection in my professional specialisation of Java.
I assessed Rust as it offers the advantages of C++ with a safer memory management model, but the language and libraries seem a little immature right now. You can call C & C++ code from Rust, but I decided this would be effort in the wrong direction and distract from point of the project.
I also considered Go but decided against as the language is garbage collected as well it lacking some of the functional programming features that are appearing in other modern languages.
C++11 and C++14 introduced and improved on several features that I’m interested in learning about. The ones that pique my curiosity the most are:
- auto keyword (because I’m lazy)
- unique_ptr and shared_ptr
- move semantics
I will be building the project with a language level of C++14 in order to learn about these features.