Our first step in learning how to make games was to decide on which programming language to use. I am an experienced software developer, so I guided this decision.
This is Game Dev From Scratch, and we want to learn about programming. We don't want to use a game maker tool or a third-party engine, at least not in the beginning. We would like our game to run in the browser, so that people can discover and play it easily. We have lofty goals, so we want to use a high-performance language.
Mainstream stand-alone games are often written in C++. C++ has been described as an octopus made by nailing extra legs onto a dog. When invited to reflect on whether he should have written git in C++, Linus Torvalds retorted that:
C++ is a horrible language. It's made more horrible by the fact that a lot of substandard programmers use it, to the point where it's much much easier to generate total and utter crap with it. Quite frankly, even if the choice of C were to do nothing but keep the C++ programmers out, that in itself would be a huge reason to use C.
If C is a dog, it's a good old dog. The C programming language was created by Dennis Ritchie in the early 1970s. In my opinion, just about every programming language that has come after C is largely inferior to C, and none is wholly superior to it. It is not so easy to get started with C compared to Python for example, but I believe that I can make up for that with some helpful libraries and syntactic sugar.
As I understand, the popular SDL2 library has been ported to work with emscripten. Using SDL2 and OpenGL, we can build a browser version of our game, and native versions for the major platforms, all from the same code base. I have some prior experience with SDL2 and OpenGL.
In summary, we considered several different programming languages for learning about game development, and we decided to use C:
- TypeScript – I don't like it.
- Python – beautiful syntax, but it's too slow.
- C++ – Linus doesn't like it.
- C is the worst programming language – except for all the others that have been tried.