I consistently see posts here claiming that Java is not a suitable language for game development. Why? I'm learning it at the moment, and I want to make games, so it's important to me that I know exactly what problems I might run into further down the line. Any info would be appreciated. Thanks.
I believe it is because of the fact it is an interpreted language, meaning it isn't compiled into machine code making it unable to run fast enough for games.
AFAIK there's nothing wrong with it. The reason it seems Java is getting flack is because of Notch using Java and having the inability to optimise code well.
Java's great for games, especially if you're lazy.
You might find this interesting then: [URL]http://www.ucigame.org/[/URL] You can get the latest version here: [URL]http://www.ics.uci.edu/~frost/Ucigame/Ucigame-20101216/[/URL]
Java is fine for games, if OP is talking about why people hate the fact that Minecraft is coded in Java, its because Notch really cant program, and thus the game is unoptimized, and slow for allot of people
Come on, the 'java not being made for games' argument precedes Minecraft by years, if anything Notch has proven java, IN THESE TIMES can be made very useful for games, the reasoning behind this is because computers have advanced crazily in terms of how much they can compute that a lot of languages, not only java, are being seen as increasingly more useful since performance is becoming less and less of an issue due to advances in hardware efficiency. It's an old argument from times when average PC performance was nowhere near the level it is today, if you feel like making a game in ANY language, go right ahead, there's basically no reason to believe you can't accomplish anything. Especially with technology on your side!
[QUOTE=Nigey Nige;28534216]I consistently see posts here claiming that Java is not a suitable language for game development.[/QUOTE]
java isn't suitable for [i]anything[/i].
[editline]10th March 2011[/editline]
[QUOTE=tommyc225;28534342]the fact it is an interpreted language[/QUOTE]
uh what.
[editline]10th March 2011[/editline]
[QUOTE=a203xi;28538138]Come on, the 'java not being made for games' argument precedes Minecraft by years, if anything Notch has proven java, IN THESE TIMES can be made very useful for games, the reasoning behind this is because computers have advanced crazily in terms of how much they can compute that a lot of languages, not only java, are being seen as increasingly more useful since performance is becoming less and less of an issue due to advances in hardware efficiency. It's an old argument from times when average PC performance was nowhere near the level it is today, if you feel like making a game in ANY language, go right ahead, there's basically no reason to believe you can't accomplish anything. Especially with technology on your side![/QUOTE]
runtime optimization > processing performance
[QUOTE=Nigey Nige;28534216]I consistently see posts here claiming that Java is not a suitable language for game development. Why? I'm learning it at the moment, and I want to make games, so it's important to me that I know exactly what problems I might run into further down the line. Any info would be appreciated. Thanks.[/QUOTE]
Well, one problem you'll run into is that when writing a game, you're better off using a language that has lots of stuff available for it - tutorials, past projects, libraries, engines, etc. are all good for starting off with game programming, and you'll likely choose an engine that you'll use for most of your programming career. While I'm sure java does have a few made for it, the vast majority of all these will be for C++, with C# up and coming as a big language for game development as well.
it's a pain in the ass with Android because the garbage collector likes to run every few seconds.
But more in general, I don't like how Java does enums, to get it to store a value requires writing an enum constructor, a private variable, and an accessor. And you still can't have a type-specific switch case block using enums without it getting very complicated...
eg [code]switch(myEnumValue)
{
case MyEnum.Value1 | MyEnum.Value2:
doStuff();
break;
}[/code]
returns an error. You'd have to do something like this:
[code]
switch(myInt)
{
case MyEnum.Value1.getValue() | MyEnum.Value.getValue():
doStuff();
break;
}[/code]
the only thing I dislike about C# is the fact that you can't fall through cases unless the cases are stacked without anything between them. Other than that it all feels very intuitive, and I'm planning on doing all desktop game programming with C# and OpenTK as the graphics library
[QUOTE=robmaister12;28540583]it's a pain in the ass with Android because the garbage collector likes to run every few seconds.
But more in general, I don't like how Java does enums, to get it to store a value requires writing an enum constructor, a private variable, and an accessor. And you still can't have a type-specific switch case block using enums without it getting very complicated...
eg [code]switch(myEnumValue)
{
case MyEnum.Value1 | MyEnum.Value2:
doStuff();
break;
}[/code]
returns an error. You'd have to do something like this:
[code]
switch(myInt)
{
case MyEnum.Value1.getValue() | MyEnum.Value.getValue():
doStuff();
break;
}[/code]
the only thing I dislike about C# is the fact that you can't fall through cases unless the cases are stacked without anything between them. Other than that it all feels very intuitive, and I'm planning on doing all desktop game programming with C# and OpenTK as the graphics library[/QUOTE]
i think you might be doing it wrong, unless im missing something
[url]http://download.oracle.com/javase/tutorial/java/javaOO/enum.html[/url]
that example only uses something like MyEnum.Value1, not something that uses a bitwise operator like MyEnum.Value1 | MyEnum.Value2.
If you want to use bitwise operators on an enum, you can't. You need to do the class with public static final ints thing, or have the enum store an int value, which would basically get around the whole point of having a type-safe value.
There is an EnumSet class, but it's too slow for a game on a cell phone, where every little thing counts for performance.
and storing a value in an enum requires writing a constructor for it: [url]http://www.java2s.com/Code/Java/Language-Basics/Useanenumconstructor.htm[/url]
I just wish people would stop bashing Java's usefulness whenever it's mentioned. I'm trying really hard to become a good programmer and it's hard to stay motivated when people suggest everything so far's been wasted effort. :saddowns:
Meh, being a good programmer does not depend on the language you use. Once you are a good programmer, you can pick up a new language pretty quickly as well.
[QUOTE=Nigey Nige;28545038]I just wish people would stop bashing Java's usefulness whenever it's mentioned. I'm trying really hard to become a good programmer and it's hard to stay motivated when people suggest everything so far's been wasted effort. :saddowns:[/QUOTE]
I don't see how it would be a wasted effort. Java is one of the most widely used programming languages, and having it on your resume is an easy way to land a job pretty much anywhere for business apps. C# and C++ are your next best bet.
Also, a lot of people hate Java because they don't take the time to learn it and end up making retarded syntax errors that they can't figure out (afterall, it's a different language, there are always subtilities), and then end up thinking Java is "shit". And a lot of people also hate it because they write slow code and then complain that their slow code runs slowly in Java.
And then you have the people with valid complaints. It happens, but it's a rare sight on this forum when it comes to Java.
This could be a bit off-topic, but what languages is the best to have on your resumé when searching for a job within game development? I think it's in this order, what do you think?
C++, Lua, C#, Python, Java
[QUOTE=sc0ut;28545596]This could be a bit off-topic, but what languages is the best to have on your resumé when searching for a job within game development? I think it's in this order, what do you think?
C++, Lua, C#, Python, Java[/QUOTE]
I'm no expert, but I think Python should be way further down the list.
Also, correct me if I'm wrong, but surely Lua wouldn't be much use on its own, as it's just a scripting language?
[QUOTE=Nigey Nige;28546013]just a scripting language[/QUOTE]
No such thing.
Wurm Online and Runescape.
Two examples of the problem.
Even tho im on the side of people that say you shouldnt use java for games
When used with a good engine you can get some impressive results such as these games
[url]http://jmonkeyengine.com/showcase/videos/[/url]
[QUOTE=sc0ut;28545596]This could be a bit off-topic, but what languages is the best to have on your resumé when searching for a job within game development? I think it's in this order, what do you think?
C++, Lua, C#, Python, Java[/QUOTE]
For game development? C++, HLSL/GLSL, C, asm, make sure to mention DirectX and/or OpenGL and the implementation of a scripting language into a program.
There's no reason why you couldn't, the main advantage of Java is its portability - you can run nearly anything you make in it on any system that supports Javam without having to change the code. I recently finished a 2 week game project in Java for my CS/Maths degree, and the libraries provided are insanely useful for making things go quick. There isn't as much control as in C++ but christ, after learning Java, I never want to program in C again, it's far too low level for my liking.
On the Notch/Minecraft thing, some people at University said he'd get a very low mark if he submitted the program for a piece of coursework, but I think what you're forgetting is that he actually programmed it and had the commitment to do that. That's just as much a part of being a good programmer as actually writing good code is.
I think I'm going to teach myself C++ and use that for making games though, because well, everyone else uses it.
[QUOTE=gparent;28546206]For game development? C++, HLSL/GLSL, C, asm, make sure to mention DirectX and/or OpenGL and the implementation of a scripting language into a program.[/QUOTE]
asm? why would it be necesary to know assembly?
[QUOTE=Richy19;28551347]asm? why would it be necesary to know assembly?[/QUOTE]
It isn't.
Bu its 4th on your list before C#
And c# is one of the most used languages for tool development
[QUOTE=The DooD;28546049]Wurm Online and Runescape.
Two examples of the problem.[/QUOTE]
Tell me one thing that's wrong with Runescape and you can blame Java for.
I've always wondered this too. But then I see games like Runescape and Minecraft which are made with Java, so I realize that it's a capable game programming language.
Java isn't necessarily all that bad, like I said in my earlier post, there are just a few things where I'm annoyed at the way they implement things. (mainly enums IMO)
[QUOTE=Darwin226;28552153]Tell me one thing that's wrong with Runescape and you can blame Java for.[/QUOTE]
I lied :(
Sorry, you need to Log In to post a reply to this thread.