Game programming: C++ vs Java

Hello!
I am doing college of technology in digital games and would like to know why it is easier to program games in Java than in C ++?
We learned the basics of programming in C ++ but when it begins the study of object-oriented programming and games, the disciplines are in Java because according to teachers is easier.
Why?
closed account (o3hC5Di1)
Hi there,

I can only partly answer the question because I don't know Java.

What I do know is that programming 3d games such as the big selling titles are usually written in C++, but the complexities of graphics programming and efficiency-optimizations are quite high. Java also has a lot of built in libraries to handle a lot of things, whereas with C++ you are usually looking at writing or using 3rd party libraries.

Java has also fully embraced the OOP (object Oriented Programming) paradigm in the sense that in JAva, everything is an object. As C++ was built on C, you could technically get by without using any OOP principles, although that's not exactly the purpose of the language. Quite some degree courses seem to believe that because of this, Java is a better choice for teaching OOP principles.

Anyway, I probably already said too much based on my limited knowledge of Java (and C++), so perhaps someone else will be able to give you a more specific / elaborate answer.

All the best,
NwN
Last edited on
NwN, I think that's a good answer.

Java is higher-level which means that there are more built-in utilities. Because it has a lot of built-in functionality, you spend more time playing with your objects, and less time doing the "under the hood" computer sciency stuff.

The problem with Java is that the higher-level utilities are not always the most efficient way to do something. It also doesn't compile into something that can be read directly by a processor, but something that an engine needs to parse before applying the code to a particular computer. These characteristics of the language make Java less efficient than a C or C++ application, but often easier to use.
As an added point, C++ should not be treated as "C with extra stuff", but rather as a separate language entirely with the ability to use C in extreme cases.
I just finished up my programming classes and I think these guys pretty much covered it. When you go beyond console programming in C++ there isn't much you can do with out adding additional libraries even for simple GUI programs. Java lets you do GUIs relatively easily out of the box, even without using a form builder.

Thank you for the answers,they are very enlightening!
After finishing my studies with data structure, I need to start studying java and OOP.Java is not my favorite language, so I resist a bit to learn this linguagem.But to graduate, I am forced to learn java :(
Topic archived. No new replies allowed.