IS JAVA BETTER THAN C++?

Started by
7 comments, last by nitro123 23 years, 8 months ago
Is java better than C++ for game programming? Adtomi.com
Bob Jones
Advertisement
For small applet-type games, I think it is. But for anything else, c++ has a lot more power and is definetely better, at least until we have faster computers that can interpret Java faster.

- Daniel
VG Games
- DanielMy homepage
Is milk better than crude oil?
Depends for what you intend to use it.

And this will attract flamers quicker than a barrel of crude will attract speculators...

An objective viewpoint is that they are currently almost on a par as far as low-level performance goes. I''ve seen the benchmarks and taken them apart, the IBM Virtual Machine is a true work of art. The biggest problem with Java would then be API support, and I think there are Magician bindings for OpenGL... forget about DirectX though.



People might not remember what you said, or what you did, but they will always remember how you made them feel.
~ (V)^|) |<é!t|-| ~
It's only funny 'till someone gets hurt.And then it's just hilarious.Unless it's you.
Oh no, another one of these posts, yuck !!

Green Erick Software
Erick, if you don''t have anything to say about the topic, SHUT UP!


People might not remember what you said, or what you did, but they will always remember how you made them feel.
~ (V)^|) |<é!t|-| ~
It's only funny 'till someone gets hurt.And then it's just hilarious.Unless it's you.
I would say that using JAVA to make a 2D game is far more easier than using C++.
Java2D is there, many classes are available to help you, load images,...
Java2D as many usefull features and as far as you don''t want to draw several hundreds of sprites on screen using tones of slow features (alpha blending) you should get a good/acceptable frame rate.

JAVA gives you the chance to make a crossplatform game, and to me this is a good thing.
People all enjoying the same game and/or playing it on the internet forgetting about the windows/Linux/BeOS... war and Mac/PC war...

Just my opinion.

-* So many things to do, so little time to spend. *-
-* So many things to do, so little time to spend. *-
Java is very good for applet things but sucks big time for real applications, not having pointers to play with GAAAAH horrible

Java is a superb language for game development. Unfortunately, due to the overheads of virtual machines (and I don''t care how fast you tell me IBM VM is) it just isn''t practical for commercial game development - at the moment.

Conceptually, there are a lot of things I like about Java, and it's getting closer and closer to C++ in terms of execution speed (as JIT compilers improve), however there are a few things about it that I do not like:

  • Java programs have a large memory footprint. Blame the interpreter, but expect a Java app to occupy way more memory than a C++ app that does the same thing.

  • Garbage collection. While I like garbage collection as an option (and it's terrific for scripting languages), the efficiency-minded side of me really chafes at not even being *able to* explicity delete an object. Finalize is there which will be called "someday" but this isn't enough. Score one for Java as a scripting language but a strike against it as a high-end language.

  • Operator overloading. This is a big one. I know they argue that OO can lead to ambiguity but I think they just say this because they haven't implemented it (presumably to keep the compiler or interpreter simpler). IMO I have a difficult time considering a language "truly object-oriented" if it doesn't support OO. I make a matrix class and I want to add my matrices together. Why should I really be required to call: mymatrix.add( othermatrix ) ? Sure, the meaning is quite clear but I find the lack of OO very limiting.

  • Templates. This is the other big one and a feature I've really come to appreciate with C++. Java doesn't have. Means much unnecessary and repetitive code to write. Me irked.

  • The run-time engine. I think this may be an issue of "too little too late." First, the "write once, run anywhere" mantra has become "write once, debug everywhere." Generic bytecode sounds good in theory but so far it's not doing so well in practice. Also, there are a lot of times when I don't need or want bytecode. Sure, there are JIT compilers, but not everywhere. Finally, a number of big companies have processors that sit on the mainboard next to the CPU that can actually do realtime translation from, say x86 code to RISC code at the machine-code level, on the fly, and actually make the resulting code run faster than the original! (there was a good article about this on Ars Technica about a month ago) I wouldn't be surprised if in five years things like this became a standard feature in computers and the need/desire for generic bytecode became a thing of the past. Also, we already have things like ANSI standards. If I write conforming C++ code it should compile and work everywhere. The only thing Java gains over C++ then is a standard threading and GUI model.


Personally, I think Java has some real strengths -- enterprise-level distributed processing, rapid prototyping, security, etc. It is a complete and powerful language that competes with VB and Delphi in terms of RAD. But I certainly don't see it supplanting C++ any time soon. At the very least, Java is an extremely young language. C++ has been around for almost 20 years. While Java may be surrounded by a lot of hype right now (as is pretty much everything internet-related), it's got a long way to go before I will consider it a robust and mature language.

Edited by - Kensai on September 12, 2000 6:07:16 PM

This topic is closed to new replies.

Advertisement