3 ms·
Ask HN: Why most of the Game Engines were written in C/C++?
I was going through the list of game engines on Wikipedia (http://en.wikipedia.org/wiki/List_of_game_engines) and was amazed to see that the primary programming language for most of them was C/C++.
- ergest 14y agoUhm performance?
- qznc 14y agoC for performance. If you need better abstractions (generics, OO, etc) you can switch to C++.
- pizza 14y agoCould you be a little more specific? What makes C++ faster than, say, Visual Basic 6? Just curious.
- ergest 14y agoC is designed and optimized to be very close to the hardware, in fact it's called high-level assembler. You can access specific hardware features directly. C++ is the OO version of C (yes I know this is an oversimplification). Other languages, like for example Java creates a logical layer (known as the java virtual machine or JVM) which adds more complexity and makes it harder to tweak your code to fit the particular hardware.
- stewie2 14y agobecause they are the best languages.
- dotborg 14y agoOpenGL/DirectX APIs are the reason
- shrughes 14y agoThey don't have garbage collection. C++ is still the most capable no-garbage-collection language.
- mingpan 14y agoAnother factor is predictability. When you write a line of code in a low-level language like C, you have a reasonably accurate approximation of what the machine is actually going to do for you at that point. Moreover, things like memory management are manual and explicit, and you have a reasonably good idea of when they happen and how long they take. In comparison, a lot of higher languages have a significant and not necessarily predictable overhead in the runtime and/or VM.