Why games made with C++ are more optimized?

532 views

C++ is the language used in almost all AAA titles. I seen youtube tests that show C++ to execute tasks faster than C# or Python for example. But i heard C is faster than C++ also, so why C++?. And what makes C or C++ faster than other languages (except assembly and machine code of course)?

In: Technology

8 Answers

Anonymous 0 Comments

C/C++ is a language built on the assumption that the developers will handle EVERY aspect of their program, this includes aspects as low level as managing memory and basic I/O(2 huge areas where bottlenecks in speed are common), if you ignore to handle any of these your program will not run at all or it just crashes when it encounter an unexpected situation, this increases complexity but because everything is managed closely you cna fine tune its performance to what you want it to be

other languages like C# and Python implement automated systems to deal with some of this basic tasks so that the developer doesn’t need to, but these systems are not specialized for all needs(or in some cases handling them is mandatory even if the program doesn’t use them) so performance is not the best it can be.

as a bonus both C and C++ have the ability to indent code from other languages most notably Assembly listings, this enables a savvy developer to implement code that is accessed VERY frequently(and hence could become a bottleneck) in Assembly in order to make sure this code is optimized at the lowest possible level before actual machine code.

You are viewing 1 out of 8 answers, click here to view all answers.