Java people, don't waste your time!

First off, I’m sorry if I posted this in the wrong forum, but I didn’t know where to place it exactly.

Okay the reason I am writing this, is that I am sad to see so much time wasted by fellow programmers. Why are you wasting your time with Java? You personally care for the language from am R&D point of view or are you afraid of C++? (no offence)

I work in a highly respected gaming company for the last 8 months. Let me tell you something. Java as a professional tool for games creation is not an option. Garbage collection? A joke. Lack of pointers? A bad joke. Cross platform? Who needs it if it’s gonna slow down my program by up to 30%?

I understand that you love Java. I love it too, I think it’s a beautiful way for someone to learn OO programming and create some fun stuff, which is basically applets. I went through most of the topics in the forums here and there’s ALWAYS the question of if Java can cut the mustard. Stop feeling insecure and go to the regular designing techniques. Even if you have never programmed C++ before, the transition would be less painfull from the trial and error routine that you go through (at least the people of this forum).

I know that a lot of the Java people are just Microsoft haters who support anything that is not Microsoft (just as Microsoft hates everything not-Microsoft). That’s OK, but does Sun care about you at all? Did they care enough to release some decent documentation on applets? Do they care enough to even tell us the basics? What is the most EFFICIENT way to use update() and paint() in an applet? Why is the Microsoft VM like thousands of times faster than Sun’s plugin? Why don’t they work hard enough (at Sun) to create something that is PERFECT? (when you’re fighting Bill Gates, you’ve gotta be perfect).

In case you haven’t heard, Sun is losing the battle by the day. Last year’s profits were decreased by 25%. And they will ultimately loose for the same reason that Netscape lost. Because they just can’t keep up with Microsoft. I was using Netscape from the day it came out. Netscape 3 was a better product compared to IE 3. But when Communicator 4 came out with all the bugs, I switched to IE like everyone else. Look at Netscape now. From global domination, they went to the 3% of the users. Same thing with Sun. Have you seen Swing applications? I mean big ones. Did they drive you insane with their lack of speed? Have you ever used Sun’s forte?

Sun has to work fast, but they don’t seem they have what it takes to do it. First and most important. They HAVE to release a Java compiler, as a professional developement tool. No more bytecode, JRE, JVM, Java Plug-in and cross-platform. Keep those just for applets. Start cooperating closely with the general public-with people like you and produce up to date and crystal clear documentation. Stuff like that.

They’re even losing the mobile phone games just for the lack of standardization. Flash wins the battle at online applications.

So stop going crazy with Java and do what tha pros do. If you want to create PC games use DirectX and for cross-platform SDL. Don’t quit Java, use it for retro gaming stuff, everyone above 25 still loves it.

You think that a software house will ever use Java for a graphics engine? Have you seen many commercial titles bult entirely on Java 1.4? Not in a milion years.

Regards to all!

trent

Cor, we haven’t had a trolling like that for a while now!
We believe, collectively, you are more or less wrong on nearly every count, Trent.

Although we’ve all got our grumbles about our own pet problems with Java. I’m all for static compilation, but I don’t think Sun need to do a compiler for it seeing as Excelsior are doing such a fantastic job.

The 1.4 JVM is faster in most real-world circumstances than the MS VM I believe now. The garbage collection is state-of-the-art and significantly better than any other system available today. For what it’s worth, my code spends so little time garbage collecting through proper design that I no longer worry about it buggering my frame rate smoothness. When we see escape analysis implemented fully (next year sometime?) I suspect garbage collection issues will be laid to rest forever.

I have pointers, thanks, and I have a little DLL to take care of things that Java doesn’t do right all on its own.

The performance of my code is generally the same as a game written fully in C++. It would be definitely be slightly slower if it weren’t for the fact that the bottleneck is graphics rendering.

And now I’ve learned mostly everything that needs learning to do with making Java proper fast and efficient, I find that I seem to be cutting code rather faster than I do in C++. Much, much, faster. In dribs and drabs I share things in here with the best way I’ve found to do things. This is why I’m not going crazy with Java, and I think I can now call myself a pro, finally, having just sat down and figured it out instead of giving up when it doesn’t do what I thought it did.

I wouldn’t read anything into share prices of individual companies by the way over short periods (i.e less than 10 years). There are many more factors affecting the value of shares than the subjective worth of a computing concept.

Swing sucks on a number of counts. And so does the AWT. The SWT is remarkably good. And so’s the homegrown realtime GUI I use. There’s no obligation to use Swing. YMMV.

And finally, there’s a bunch of studios using Java now, and a bunch of games been released with Java in there somewhere, and a very few entirely written in Java. I’m writing one now. Just a little one, but a proper one.

Take care, and keep that mind open.

Cas :slight_smile:

Yes you did post it in the wrong forum. If you want a flamewar, Javalobby is the place for you.
I assume you’re also posting your message to a number of different forums: I’m sure that the people who are using Basic, Tcl, Delphi, and any other language that doesn’t fit with your conformist view, would also love to hear from you.

[quote]Have you seen Swing applications? I mean big ones. Did they drive you insane with their lack of speed? Have you ever used Sun’s forte?
[/quote]
Take a look at eclipse:

A massive editor that is pretty speedy written in Java. Lots of plugins for it too.

It’s sad to see that my casual remarks, caused such a hostile reaction. I’m afraid that Java DID drive you crazy…

This is almost like watching Cartman in Southpark!

Netiquette states that if you wander into some forums unannounced and tell everyone they’re wasting their time and that what they’re doing is amateur, that you are likely to receive a considerably more hostile reaction than you’ve got!

http://www.java-gaming.org/samplecode/Terrain.zip was written in Java (needs JRE1.4 and Geforce) and although it isn’t much of a game (yet - it might be one day, fingers crossed) it fairly well dismisses the notion that Java can’t cut it on nearly all counts, and I hope provides a little beacon of hope to developers that they can achieve whatever they please with Java if they just sit down and think about it for a bit.

Cas :slight_smile:

(oh, and, er, Virium, sorry to spoil it but Eclipse is written using SWT which is why it’s so fast and good looking. But JBuilder is a good example of a very fast Swing GUI. Although it eats RAM like nobody’s business)

Cas :slight_smile:

[quote]It’s sad to see that my casual remarks, caused such a hostile reaction. I’m afraid that Java DID drive you crazy…
[/quote]
I agree with Cas. You most certainly have not received a hostile reaction – despite the fact that your obvious troll deserves one.

I would question your motives for coming to this site at all considering your opinions.

J

I actually want to thank Trentboy as I find him quite amusing.

There are things that Java can do that C/C++ cannot, perhaps the most important of these is the ability to dynamically move code about. At least in my mind this opens up tremendous possibilities and actually taking advantage of it pays my salary.

The gaming industry once said the same things about C, then C++ as programming languages. Troll on you crazy diamond :slight_smile:

Bill

[quote](oh, and, er, Virium, sorry to spoil it but Eclipse is written using SWT which is why it’s so fast and good looking. But JBuilder is a good example of a very fast Swing GUI. Although it eats RAM like nobody’s business)

Cas :slight_smile:
[/quote]
Its still a Java program though…

I think Java is at the beggining of what will be a really impressive life span. I try not to get into arguments about Java because I’ve found the basis of the arguments almost always fall into two groups. The first is the group that dislike java because either cannot see a big picture or activly do not want to see a big picture. The other is the group that see beyond the here and now and get the big picture. What is the big picture? For me it’s where a project is gonna be in 1, 2, or 5 years; it’s the unforseen problems; it’s my future. It’s abstract and for that reason it’s hard to comprehend.

[quote]I work in a highly respected gaming company for the last 8 months.
[/quote]
That big picture doesn’t mean much to you, you’re intersted in the 2-3 months of shelf life that most games have and how to sell as many copies in that window. Also, if you want to claim or imply a high level of respect why don’t you try a higher level of tact?

[quote]You think that a software house will ever use Java for a graphics engine? […] Not in a milion years.
[/quote]
Did you ever run Window 3.1? When you were using that piece of crap could you forsee a future where you didn’t exit Windows to run games in DOS mode?

Some of what you say is right in the context of today, but that will change as time passes. I hope when that time comes you will be able to reconize it.

[quote] It’s sad to see that my casual remarks, caused such a hostile reaction. I’m afraid that Java DID drive you crazy…
[/quote]
Well. If someone has to be crazy, it must be the troll you are. Started a flame war, and got correctly cooled. As JasonB said, there are sites where your flames will burn correctly. Pass your way.
As trent said, “java people, stop wasting your time”, better code than caring for him.

to trentboy
I didn’t think your post was particularly “flamey”
You sounded fairly concerned and positive.

However…
The are several professional games out there written in java and making money.

I believe there is now plenty of room in the gaming industries for alternative technologies and the Java platform and Java APIs are an excellent choice.

BTW, Why do people keep saying that swing is slow?? I program swings apps all the time, I have yet to notice one being slow. I wish people would stop with that myth. If you see a slow Java program with a Swing interface… DON’T blame Swing unless you know that it is Swing’s fault. I like Swing, it works and it works well… it could be better, but overall I think it was well designed. Maybe there are still a few places where it is generating more than it’s fair share of garbage… But hey, Swing isn’t designed for updating game screens at 70fps.

Check out http://www.jgoodies.com/download/metamorphosis/metamorphosis.jnlp see how easy it is to get an Eclipse-like interface with Swing…

As for matching the native L&F 100%… it would be nice but it is often overrated… half the native apps you see these days do their own suctom painting to make their own L&F anyway - they go out of their way to avoid the native look and feel! Sure a user might notice the L&F isn’t exactly the saem as the native one… but it rarely affects usage of the app.

It is easy to misuse Swing and make a slow program… using default models for instance when they simply aren’t appropriate for what you want to do. E.g. if the swing default model works a certain way and that is dumb for what you want to do… it is your fault for not providing a more appropriate model if your program appears slow because of it. Swing provides the ability to replace the models for this reason and in general the default models are often much richer than what you get with a native control.

With modern VMs, slow Java programs are caused by poor programming, they are not a fundamental aspect of Java itself. Some specific tasks may benefit form putting a few key loops in native code, to avoid bounds checking where it makes a difference, or using native stubs to bind to specific features (e.g. OpenGL) could be required, but that is a far cry from going to C++ for everything. Was it worth it for SWT? I don’t think so.

Sorry for going off on a tangent, I tend to do that ;D

No Shawn, Swing is slow, on a number of counts:

  1. It takes a significant amount of time to load. By significant I mean that even for trivial applications we are talking many seconds instead of a couple for a typical native application. (I know this isn’t the JVM overhead because my GL GUIs load and run as fast as anyone else’s games - they’ve done a fair bit to get startup times down with 1.4)

  2. It uses a vast tract of physical RAM. This is fine if you’ve got 256Mb lying around but on a 32/64Mb machine you can forget it; you’re in swap hell and all of your other applications running at the same time suffer for it. Why don’t I use a Java text editor? Because I don’t want to waste 30Mb on a text editor when Textpad does it in 5Mb and runs like the wind.

  3. Try using Swing applications on a 300MHz Celeron Then use a native one, say, MSVC versus JBuilder. Tell me which one feels slow. In fact, try using a Swing application on an iPaq. Agh! It’s just plain awful.

To cap it all, the look & feel is a very subtle thing, and emulating standard widgets 100% does not necessarily help. Emulating 90% of them 100% compatible does, rather like SWT. But what a fantastic waste of resources trying to do it all in Java is! Why don’t we just emulate threads too, or a file system, or a TCP/IP stack in Java? Because the O/S is there to do it efficiently for us. There’s only so many times you can reinvent the wheel before you figure out that someone’s figured it out thoroughly already.*

Cas :slight_smile:

  • except, I believe, the Japanese, who have in fact reinvented the wheel on one of their concept bikes.

At work, I run JBuilder7 on a P3/1Ghz 256Mb machine on win2k and still its unresponsiveness and slowness drives me totally crazy.
It’s just too much of a memory hog which is my perception of swing applications in general.
(I wouldn’t dare thinking about developing swing applications using JBuilder ;D)
For me, memory hogging applications are by definition the same thing as slow applications so, yeah, I’m with princec to say that swing is slow.
Ok, I can’t prove that it’s swing’s fault but I just haven’t seen one fast swing application which doesn’t eat a rediculous amount of memory.

Erik

It’s Scott, not Shawn :slight_smile:

And I admit that many of the things that you are complaining about are something that doesn’t concern me much… load time for me is not a big problem. My Swing apps load fast enough. Memory is not a problem, because I run my apps on PCs and they have enough. I already admitted that perhaps Swing generates too much garbage… I could extend that to say it uses too much memory I suppose… but I don’t notice it causing problems for me. Running on a 300 MHz celeron doesn’t slow my apps down enough that I care. I have never tried an iPaq but that isn’t my target. In any case I would expect such a device to be relatively slow - they aren’t meant to be fast, they are meant to be glorified appointment books. People don’t by handhelds to do 3D graphics. (Yet)

As for L&F I think the waste of resources comes from SWT having to make native implementations of all the widgets that just don’t have standard equivalents on one platform or another. Or messing around to get the API to work the same with different platform’s widgets. This is where the write once run anywere of Java works perfectly. Perhaps SWT is what AWT should have been, but I don’t disagree with the Swing philosophy in which there is ultimately more control and adaptability because you mostly don’t need to worry about native code or OS features.

Swing is slower than the native widgets, that isn’t my argument. I’m saying it is still many times faster than it needs to be in everything I have ever done… so from that perspective it is not slow.

But perhaps more to the point for this forum… Swing shouldn’t be used in an action game’s main loop anyway… maybe for some configuration and setup UI, where I maintain that it will do a fine job. I mean how many games do you know of where the main graphics are based on quickly updating lists, trees, and checkboxes ;). A JScrollpane isn’t the way to write a fast action scroller… although I wouldn’t be surprized if it could be done :stuck_out_tongue:

I’ve noticed a definate speed up to Swing apps in 1.4, probably because of accelerated image drawing being added under the hood.

To be fair though, Sun aimed for 100% consistant look, which basically screws up any hopes of getting good native acceleration. And for games its even more of a moot point because who ever wanted games to have a consistant UI? Having a funky game-orientated interface is a major part of the experience. Admittedly many have a windows-based interface for the most part but style and functionality are so different that building a common code base would be minimal and highly generic - contrast the interfaces of UT and AO for good examples. Both slightly laggy i’ll admit, but i think thats more due to networking delays/data gathering that anything else.

And so I shall return to GL, where GUI effects like rotating and transparency are practically free - i just have to reinvent a slightly differently shaped wheel for my own uses…

Only on one game have I ever used swing, I have always since then made my custom components…I don’t think swing was Meant for games, but for professional apps. It might be a little slow, but the swing demo application ran fine for me.

(I have no idea why I called you Shawn!)

Cas :slight_smile: