If you ever wanted a reason to use a modern langauge...

Interesting but Tim is way off on various points which I can’t be bothered to go in to :wink: If he wanted to see a proper productive language he need really go no further than BlitzMax.

BTW .uj, about 4 years ago I decided to bet the farm on Java and I’m still in business! The very simple reasons for mainstream software houses sticking with C++ is consoles and experience and of course a total failure of Sun to push it. Give it 5 years and a Sony console running a fast JVM and you might see some change.

Cas :slight_smile:

You’re confusing the view of the programmer with the view of the user. When did you last see “this product works!” draw hordes of costumers to a new product?

Speed is different. That factor alone is behind most of the qualities that make a product “cool”. Don’t tell me you update your computer to make it slower?

If your your using hardware acceleration 75-95% of the work is being done on the card, speed of the language being used becomes far less important. The performance gains just aren’t there to be had and the net result is you just increase development time and complexity for single digit FPS improvements.

Example: You could have Doom 3 written entirely in assembly, running on a P4 3Ghz CPU, but if the graphics card sucks it won’t be playable. Conversley, you can (and do) have Doom 3 running on a P3 733Mhz processor with a custom nVidia Geoforce 4ti (an XBox) and getting 30-60FPS.

With hardware acceleration, the language being used only has to be “fast enough” - Java is fast enough.

Is there ever really a “fast enough”. The “slack” the general processor experiences because processing is delegated to the graphics subsystem doesn’t necessarily has to be consumed by the programming language itself. It can also be used to build a more complex (= more fun) game.

And in other application areas like for example scientific simulations, say weather forecasting, there will never be any “slack”. If one language consumes 15% more than some other language it takes away one day of simulation a week.

I’ll never buy the argument that it’s okay for Java to be slower than C++. Basically it should be faster. This has been the promise ever since the early hype days. Maybe it finally is after 10 years. In that case the time has come for Sun to publish unquestionable proof.

Yes - Back in the day, we used to say the same thing about C in comparison to assembly. Old school assembly argued you couldn’t use C to write games because it was to slow.

Unfortunately time is a limited resource. You sorta forgot that in your statement… well, duh… that can happen.

Programming the same thing in C/C++ already takes 3-5 times longer. Porting it to other platforms such as Mac also takes some time and now you also want to use that tiny speed advantage (which doesnt necessarily exist) to make the game even better with more processing power… mmh :slight_smile:

A game where you spend all those resources on content and level design will be usually more fun.

[quote]more complex (= more fun) game
[/quote]
I know you’re just playing devil’s advocate but never was a more untrue statement said on these boards :slight_smile: But as for Sun’s hype about the relative speeds of Java and C++, you’re spot on, it shouldn’t be slower these days, though it is most of the time. I always used to chuckle when a Java fanatic spouted the marketing bullshit to a C freak and included the words “theoretically” and “potentially” somewhere in the spiel, which the C freak always latched on to immediately…

Cas :slight_smile:

Agreed 100%. But if you refuse to ever change tools, you cannot be using the right tool for the job.

Okay there I disagree.

Having been a game programmer in the industy.

Its about MONEY.

Money has two factors-- cost to produce the product v. sales of the product…

Sales is driven by product performance, cost is driven by productivity or lack thereof.

Existance proofs defeat this statement:
Legacy Interactive, Mind Control Software, Three Rings Design, Jagex Design, Cyberstep…

In fact all of those companies have had hit and award winning games.

See above.

The big questions is “viable for what.” There have been pure Java games that were highly financially successful almost since the start of Java. (POGO games for instance.) There have been quite a few action games written with custom JNI layers to talk to OpenGL or an existing low level graphics engine.

All thats happened recently is that some reasonably standard pre-built solutions for that JNI has emerged, and about 5 years ago the VM more or less caught up with C for raw speed.

This is a nonsense question. When will we see a C compiler that doesn’t have an ASM bootstrap module? Never. Thats the nature of compiler/systems design. You bootstrap up on the back of what is already there.

MOST of the Sun JVM is now in Java and has been for awhile.

Really Cas, on the rest I put it down to difference of POV and opinion but YOU of all people should know better then to repeat this ancient nonsense cry of the c-bigot.

Edit: I shoudl have known better. That wasn’t Cas talking like an ignorant slashdotter. My apologies to Cas.

Er, I think you’re talking to .uj there aren’t you Jeff?
UNless it’s wrt. Java speed, and it’s still not as fast as C++. But it’s very nearly there. Roll on two-stage compilation and escape analysis.

Cas :slight_smile:

[quote]Don’t tell me you update your computer to make it slower?
[/quote]
You don’t use Windows, do you?

Oh your right. Sorry. Somehow i misread.

That makes MUCH more sense.

You always talk like a Java informed person. This noob on the other hand needs a lot of retraining of misconceptions and FUDded notions.

It will be interesting to see how the speed comparisons stack up with 1.6. I’ve found my Java code to be 85-95% of C++ speed back in Java 1.4 and better again with 1.5. I recently tried a 1.6 development build and it sped up my Java ray tracer by 20% over Java1.5. On the face of it, that suggests that Java must be getting reasonably similar to C++ (maybe sower in one or two spots, possibly faster here or there). The Java 5 benchmarks versus C++ looked reasonably good and it seems 1.6 is making big strides again.

This is something that encourages me about java. When was the last time you saw C/C++ compilers making 20% speed increases per version? C/C++ is very mature and is not making great new strides, Java is getting seriously improved in speed with each new release.

I guess I’m “the noob”. :wink:

I find the OP’s astonishment over that not everybody immediately abandons C++ for the “modern” Java very strange indeed. Java has been as good as it is today only a fraction of its existance. During the rest of its time the road is littered with failed projects because Java just didn’t cut it. Therefore in my view Java has a serious credibility problem it has yet to overcome.

There’s no reason what so ever to even consider Java for the next five years if you’re happy with C++ today. Java may still be around but probably as a niche language for server applications rather than the language of choise for demanding desktop applications.

If you like Java, as I do actually ;), you may try it but at your own risk. The risk is somewhat offset by the fact that Java has the support of IBM and that Microsoft is promoting a similar technology. The fact that Sun is now in bed with Microsoft has also somewhat reduced the risk of adopting Java.

So regardless of what starry-eyed evangelists like Jeff may tell you, you’re more likely to lose your job if you bet on Java than if you don’t. That’s the lesson the history of Java teaches you.

He does, er, have a point there… as a contingency I use Java in the day job though, which guarantees me a job for at least the next decade, and I can re-use my skills on the gaming front. We don’t hire C++ programmers any more.

Cas :slight_smile:

I agree, but isn’t it quite strange that we’re still talking about Java’s future speed? Will we ever be able to say that Java is as fast or even faster than C++ now.

Even after 10 years of speed increases we’re not there yet. At any given point during this long period of time have those who bought into the hype and bet on Java becoming as fast as C++ been disappointed. This is part of Java’s huge credibility deficit.

I see! You mean that by using Java the performance will suck but that doesn’t matter because the product becomes so cheap one can afford to throw it away immediately? ;D

There’s no reason what so ever to even consider Java for the next five years if you’re happy with C++ today.

Productivity, xplatform and security.

At any given point during this long period of time have those who bought into the hype and bet on Java
becoming as fast as C++ been disappointed.

Speed was never part of the hype. And how could it have been? There was no JIT at the beginning.

Sun filed a JIT patent as early as 1996-05-20,

http://www.freepatentsonline.com/6151703.html

The possibility of JIT compiling and that it would very soon allow Java to run faster than statically compiled languages such as C++ was very much part of the early Java hype.

Fair enough

Yes, actually, there is: you’re making money today with your current product, but if that product could be coerced into doing more than it does, you could make a lot more money. You’ve got a version 5 to go out next year, and you’ve chosen which 25 of the 500 possible features to include (so that it only takes 1 year to make, reather than 10).

But…if a switch to java could let you make 45 of those features in the same time-frame, you’ve got a great reason to move to java.

NB: the above was written s/java/[other language]/ - this is usually the main reason for switching language. People didnt switch to C++ for speed, they switched because they could do more in less time, so they could make more profit / put more competitors out of business / sell at a lower price but with same profit margin.

Nah, no-one loses their job for betting on java: people lose their job for writing crap that they happened to chose to write in java. Incompetence is incompetence no matter what the platform ;).

When I was first looking at using Java (> 5 years ago) I tested some of my own code and even then the speed difference between Java and C++ was modest on that code. Since then a greater variety of code now approaches C++ performance, and fewer coding tricks are required. Adding stuff like escape analysis may not speed up code which has been optimised by the programmer, but rather allow ordinary straight forward code to run as fast as that written by the performance specialist.