Why not Java?

Apprentice
Posts: 17
Joined: 2008.01
Post: #1
I saw the thread about languages/tools/enviroments used for UDG contests, and Java was near the bottom. Is there any reason why? Its got decent graphics, offers built in graphics, mouse/advanced keyboard is built in, GUIs are built in, networking is built in, its one of the best documented languages around, comes installed on every mac.


I know previously it had issues with speed and some things were poorly designed, is there any reason not to use it for the OMGCup?

Reason I am asking is because I am looking for an alternative to TNTBasic (need something with OOP and a few other things), but cant stand ruby, and don't want to deal with having to keep SDL or anything packaged (I have never done so before, and don't need any more hassles)

Please do not answer with which language I can use, dont mean to be rude, but from my experience, it always ends up in either a flame war or exaggerated claims
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
It's slow, it's very little easier to program in than C++, and if you want graphics that go faster than a snail's pace you have to package one of the Java bindings for OpenGL with your app anyway...
Quote this message in a reply
Apprentice
Posts: 17
Joined: 2008.01
Post: #3
Its not that slow these days, its being used for decent graphical stuff, but i can see what youre saying in terms of gaming, which is more intese than most proce55ing stuff
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #4
I'm sure Java would be fine for a game such as this, and if you want to use it, by all means do so. Personally, however, I wouldn't use it because I don't like the language. I don't like the fact that they force you into using objects for just about everything whether you like it or not, and whether it's worse to do so or not. I also don't like how much the discourage the use of primitives: for example, you have to use an Integer class to store an int in a vector, and use 3000x the number of methods. I also don't like how many news it takes to open a file. I also don't like the lack of pointers, since they can be very useful. I also don't like the fact that you can't use something that's not a boolean type in an if statement, while loop, etc. This is all ignoring how slow Java is...

If these things don't bother you, or you don't even know what they are, go ahead and use Java. If you do care, Java will be a living hell for you as you are trying to complete your game with a time constraint when you find out you have to do more work just to do things such as use a primitive in a data structure. Like I said, it's up to you and your preference for a language.
Quote this message in a reply
Member
Posts: 204
Joined: 2002.09
Post: #5
aqua_scummm Wrote:I know previously it had issues with speed and some things were poorly designed, is there any reason not to use it for the OMGCup?

Bottom line usually is if it works, use it. If Java provides everything you want to make your game, then go for it. Tempest is an entry for OMG and is written in Java, so why not?
Quote this message in a reply
Apprentice
Posts: 17
Joined: 2008.01
Post: #6
Ok, cool, I am fully aware of Java's downsides, having take several years of it (and knowing a few shortcuts here and there Wink ). So I think I might use it. My program is fairly simple anyways
Quote this message in a reply
Member
Posts: 304
Joined: 2002.04
Post: #7
Lots of kewl games are written in Java (Ultratron for example) - if you feel most productive in Java and it is a good fit with the type of game you want to write then go for it aqua_scummm!
Quote this message in a reply
Member
Posts: 196
Joined: 2003.10
Post: #8
Quote:most proce55ing stuff
Of course, if you are t3h l33t h4k0r, you should be using assembly Wink
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #9
Using lwgl and other GL bindings people are doing some seriously hairy java programming.

Tribal Trouble, for example: http://oddlabs.com/tribaltrouble.php

Java shouldn't be discounted. Sure, it's not as fast as C++ ( and doesn't have true templates or operator overloading ) but it's a hell of a lot faster than Python or Ruby. Of course, it doesn't have their advantages, either, since it's basically just a garbage-collected version of C++, with more robust RTTI.
Quote this message in a reply
Talkie Toaster
Unregistered
 
Post: #10
Java proponents say Java can actually approach the speed of C++ with the revolutionary new JIT compiler. (In this context, "new" means "Smalltalk had it in the 80s". This actually seems to apply for a lot of the Java hype.)

All I know is that whenever I try to actually run an application written in Java on my computer, it gobbles up RAM like there's no tomorrow and makes me long for the blazing speed of my 8mhz Mac SE.
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #11
Try tribal trouble, then. Butter-smooth OpenGL and animation. Peppy, fast, and responsive. It astonished me -- and I'm a C++ guy.

Java's bad performance comes, mainly, from Swing being over-engineered and because the VM is loading so goddamned much just to boostrap. A Java VM is *almost* an entire operating system. It has to be, since it has to normalize an operating environment across so many platforms.

In terms of raw numerical performance, Java's not bad. It sometimes beats C/C++, and sometimes loses. Regardless, 90% of good optimizations come from smarter algorithms, and not implementation details.
Quote this message in a reply
cimot
Unregistered
 
Post: #12
Hi I'm newbie here & use Java for my current OMG entry(Boxing Fever)
http://www.idevgames.com/contest/downloa...hp?file=11

I'm using GTGE as game engine
http://www.goldenstudios.or.id
the engine is simple and straight forward, very easy to use, also can use OpenGL and LWJGL as add-ons.

Apple very support in Java, and had made Java as the first citizen in Mac and also alot of pro argument using Java as Game language.. if you want to see wonderfull games written in Java go to:
http://www.lwjgl.org/projects.php

I wonder if there any special thread for each language just for discussing anything usefull in Mac gamedev & every each language have a moderator who also specialized with the language so can help newbies, I mean it would be really great to have such a thread.
Quote this message in a reply
Member
Posts: 89
Joined: 2005.06
Post: #13
aqua_scummm Wrote:Its not that slow these days, its being used for decent graphical stuff, but i can see what youre saying in terms of gaming, which is more intese than most proce55ing stuff

You did not just say proce55ing... Blink
Quote this message in a reply
Member
Posts: 254
Joined: 2005.10
Post: #14
From what I've read and experienced, Java's speed issues come from one of two places. One of those is the Java VM. Much more often the 'speed' issues of Java come from crappy programers... well, its not so much that they suck at programming but they have little understanding of the Java language and/or its frameworks.

For example...
Code:
String myString = "Hello";
String anotherString = "World";
myString = myString + " " + anotherString;
Anyone know how many String objects I have floating around in memory at the end of the above code? If I remember correctly there are 3. The reason for that is that a String object is really an ImmutableString. Most people don't realize this and if you are concatenating strings in a loop you create objects FAST! On top of that no one knows when the Java Garbage Collector will collect those unused objects.
(BTW, the correct way to concatenate strings with out creating a bunch of objects is to use a StringBuffer.)

Plus a lot of people just trust the garbage collector to function well. Not good when you are doing a game. Probably you should be calling the garbage collector manually.
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #15
Another large problem with Java is everything is on the heap unless it's a primitive. Period. Arrays, strings everything. If you have a fixed size array, you can't gain the speed benefit of having it on the stack like in C/C++. Also, you can't create any objets on the stack like C or C++. That is really the most efficient way to handle memory. (as long as you don't need it on the heap, that is)
Quote this message in a reply
Post Reply