[java] Is Java a good Language

Started by
43 comments, last by yaroslavd 19 years, 8 months ago
I am taking 2 java courses next year along with an animation course, and I want to get into game development. MY question is... Is Java and alright language to program games in? After a few dinky games, I want to make a 3rd Person 3d MMORPG like "Runescape", "Eternal Lands", and "Another World Online". I'll be using alot of different textures and animations as well as effects like reflections and stuff. SHould i go with java or just drop the courses and go for learning C++ on my own? EDIT: I Never amagined this would turn into a debate on which language is better... C++ or Java... ! [Edited by - Runyon on August 8, 2004 10:08:04 PM]
Advertisement
No matter what language you choose, I think that the jump you're proposing is too large. I don't know why every aspiring game programmer decides to move into 3D upon completing, say, a text-based RPG. But, take smaller steps. That said, I always suggest that if you intend to use C++ some day, you're better off learning it first because, otherwise, you'll use C++ like a Java programmer. And that just doesn't work well. There are too many kids out there using new on everything, with absolutely no clue why they're doing it or what alternatives there are. So, if the courses are mandatory, stick with them and learn C++ concurrently, focusing on the differences between the two. Otherwise, to hell with Java; you can always safely pick it up later.
Alright... I am going to start off with C++. It probably wont be the easiest thing in the world but w/e
It's a decent language.



(I despise it more than anything on earth, but that's a whole different story.)
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Java can be used to make games. Take a look at http://www.mojomonkeycoding.com/ .
[vulgar personal insult removed -SiCrane]

[Edited by - SiCrane on August 8, 2004 8:33:42 PM]
Runyon, your original post was very likely to trigger a flamewar, sooner or later. Hence it was likely to annoy people.

If you had any experience of programming you would know that your question is meaningless - almost every language is a good language to program games. What usually matters is the availability of 3rd party libraries (of which OpenGL is one). If you try a language which doesn't support OpenGL, for instance, I'd suggest it's a poor choice for doing most games (but still could be very good for others).

The fact is that these days it is extremely hard to find any mainstream language that does NOT support OpenGL etc.

Getting back to the point: worry about becoming a good programmer before worrying about which language to use. Right now, you CANNOT GET THE RIGHT ANSWER to your question, because you are simply too naive to know what questions to ask (and we can't answer particularly helpfully until you do).
On an absolute scale, Java is probably the best mainstream language you could possibly program in at the moment.

But this isn't what you really want to know. What you really want to know is something like one of the following:

"For the game that I choose to write, which...

- will be the easiest language to write it in?
- will be the fastest to write in?
- will run the game fastest?
- will produce the least buggy game?
- will give me the best chance of getting a professional job in the games industry?
- ...etc

E.g. for the last one, java is one of the worst languages in the world (although even EA are currently recruiting java games programmers, it will be another 5-7 years before java is common for games studios).

However, for the second to last one, and for the second one, C++ is one of the worst languages in the world.

Taking a gross generalization, Java is about as good on average as C++ for games programming; in some ways much better, in others much worse. If you're just writing a game, then it's definitely better. If you want a game-programming job afterwards, it's definitely worse.

For examples of some games written in java (mostly by hobbyists - but includes a fast Quake3 clone), see the Java Games Factory: http://grexengine.com/sections/externalgames/<a/>
Coming from person who started as a C++ programmer, and then took a few classes in Java, I think it is a better idea to learn C++ before, or at the same time, as you are learning Java. Why? Because Java does a lot of things behind your back like Garbage Collection that can take a serious performance hit on your game if you don't know what's happening behind your back. Learning C++ will teach you that for the most part you need to manage your own memory deallocation.

Some people I know who know Java, but not C++, don't realize the cost of the Garbage Collection running at any given time in a Java program. An example, is say that your processing a complex 3D Graphicical battle in a game, and the Garbage Collector decides its time to run = Perfromance Hit. I don't program in Java too much, especially not for games, but I'm pretty sure that you can explicity deallocate objects in Java, but that class you're taking probably won't teach you that because Java does it for you. If its just a regular programming course, it may be geared towards business apps, in which no one cares if there's a slight delay when running it. In games, a delay at certain portions of your game will make it an awful game, because people will think that its slow.
I'm afraid you don't know what you're talking about...

Quote:Original post by wyrzy
Why?


I agree some people find it easier to do C++ first - because java was based on C++, so a lot of things make more sense once you've understood what java was trying to avoid or reproduce. But then I've also seen as many people who found it easier to do java first, since it doens't have lots of the flaws and bugs in C++'s design

Quote:
Because Java does a lot of things behind your back like Garbage Collection that can take a serious performance hit on your game if you don't know what's happening behind your back. Learning C++ will teach you that for the most part you need to manage your own memory deallocation.

Some people I know who know Java, but not C++, don't realize the cost of the Garbage Collection running at any given time in a Java program.


No. Java does NOT tend to do this. You do not understand GC in java.

- Traditional GC does NOT cut in at random times, it only cuts in when you run out of RAM and would have had a crash due to "out of memory error". This is usually a sign of very stupid programming
- Incremental GC does NOT have noticeable performance impact, because it runs bit-by-bit all the time, so the impact disappears inside downtime you had anywya - unless your game is stealling 100% CPU from the OS, in which case you'll see something like a 1% decrease in framerate


Quote:
I don't program in Java too much, especially not for games,... In games, a delay at certain portions of your game will make it an awful game, because people will think that its slow.


Yeah, so don't go around telling people stuff you don't know about.

Java GC has no negative impact on games. Period. Unless you are an incompetent programmer, or happen to use some very unusual code. It is possible to deliberately write an application that has problems due to GC - but this usually requires writing code that you would never write because it's worse in every way than the more obvious ways of doing it!

This topic is closed to new replies.

Advertisement