The main reason C/C++ is the standard is because many early graphics libraries are in C. (I know there are earlier ones but for modern games' concern, it's C). C++ is an extension to C and therefore natural to adapt to from C.
Additionally, C++ is more efficient because it is closer to hardware due to its connection to C. Having said that, this does not mean Java is not efficient. Java have changed over the years and have become more and more efficient. However I think it is fair to say that C++ allows EASIER optimization and GREATER control over your code than Java. This is what I mean by "more efficient". With C++/C, you can literally fine tune your code to fit cache sizes; you may directly code assembly and force compilers to use your code instead of generate something that is potentially not optimized; finally Java makes everything into an Object which "forces" you to make MANY function calls... this mean that there will be a lot of stacks been made which lead to less efficiency when C++ is also OOP but less function calls (depends on developer).
Having said that, C++ also come with great price.... SO MANY BUGS! SO EASY TO MAKE BUGS because it is too powerful.
So Java is a good place to start and develop games for mobile and perhaps PC, but ultimately if you want optimization, it's C/C++
CXD
Java or C++?
As has been said, you should learn multiple languages.
Focusing on just one may force you into a certain mindset of solving problems, when actually better methods exist in a different language.
For example, I don't like the "OOP or die" mentality of java and its usage of exceptions. Yet, the garbage collector is a great tool.
On the other hand c++ has RAII and is a multi paradigm language, which gives you great freedom of expression but it is riddled with legacy stuff, inconsitensies and (arguably) very ugly syntax.
Focusing on just one may force you into a certain mindset of solving problems, when actually better methods exist in a different language.
For example, I don't like the "OOP or die" mentality of java and its usage of exceptions. Yet, the garbage collector is a great tool.
On the other hand c++ has RAII and is a multi paradigm language, which gives you great freedom of expression but it is riddled with legacy stuff, inconsitensies and (arguably) very ugly syntax.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement