News for hackers. Stuff that matters.
Re:Ask HN: Why most of the Game Engines were written in C/C++? by mingpan on Thursday December 27, 2012 @07:21PM (#4975824)
Another 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.
Re:Ask HN: Why most of the Game Engines were written in C/C++? by ergest on Wednesday December 26, 2012 @12:56PM (#4970124)
Uhm performance?
Re:Ask HN: Why most of the Game Engines were written in C/C++? by pizza on Thursday December 27, 2012 @02:34AM (#4972707)
Could you be a little more specific? What makes C++ faster than, say, Visual Basic 6? Just curious.
Re:Ask HN: Why most of the Game Engines were written in C/C++? by ergest on Thursday December 27, 2012 @10:01AM (#4973493)
C 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.
Re:Ask HN: Why most of the Game Engines were written in C/C++? by qznc on Wednesday December 26, 2012 @01:36PM (#4970281)
C for performance. If you need better abstractions (generics, OO, etc) you can switch to C++.
Re:Ask HN: Why most of the Game Engines were written in C/C++? by shrughes on Wednesday December 26, 2012 @04:08PM (#4970915)
They don't have garbage collection. C++ is still the most capable no-garbage-collection language.
Re:Ask HN: Why most of the Game Engines were written in C/C++? by dotborg on Wednesday December 26, 2012 @03:52PM (#4970847)
OpenGL/DirectX APIs are the reason
Re:Ask HN: Why most of the Game Engines were written in C/C++? by stewie2 on Wednesday December 26, 2012 @03:17PM (#4970722)
because they are the best languages.