First of all i would like to have a real answer, i’m always trying to get more from various sources and articles, and when I read things like C++ is slow because it has virtual functions and because of this C is better, i really don’t know what to say and think as an human being with a brain. So please avoid to reach this level in your answer/s.
My question is about a massive switch to C++ that was completed, more or less, with Doom 3.
The interesting thing for me is that before this milestone, most of the game engines and the games itself were written in C, just like it was since the Quake era. It’s also interesting to note that the ID software decide to completely rewrite the codebase for the IdTech 4 in C++, a massive amount of work that honestly i can’t understand without a really good list of reasons.
I’m focusing on Doom 3 because I am mainly interested in the OpenGL world and in my journey i try to stay focused on this topic, so i read a lot about this, but i think that a question like that can be render-API-agnostic without too much problems.
Why at a certain point in time the industry switched massively to C++ ? What are the reasons for the choice that ID made ?
The last thing that i would like to say is that the C language is much more simple to implement and provides a less number of features, because of this has much less chance to be “fragmented” in pieces unlike the C++ really often does. In simplest terms i have much more chances to find a really good C compiler rather than a good C++ compiler with all the features implemented in a good way.
For example the NDK for Android still doesn’t have a good C++ support ( with the r8b release ) with all the latest and greatest features, and it’s the native toolkit for the most popular mobile OS in the world!
If I had wrote my code in a modern C++ I would probably be in pain now because one of the most popular OS in the world would be off-limits for me. And like Android, many other compilers are not that great.
I should write C++ code referring to a C++ version that is 2-3 release old ?