C++, Java (C##) and the old question of speed

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
buezi
Posts: 3
Joined: Mon Apr 19, 2004 3:52 pm

C++, Java (C##) and the old question of speed

Post by buezi »

In the first years java was a totally interpreted language. Therefore it used to be very slow because there was this run-time engine using large part of the cpu-time. Lots of the old "java is slow" prejudices come from this time. Nowadays java runs on a so called just-in-time compiler, this means before a statement is used it is transformed into the needed machine dependent instructions. This approach gave java a large speedup, so I guess now it would be possible to run a game with java. Especially, not every game really needs the last bit of performance.
As far as I know C++ is still faster, but I think this is only a question of time, the same arguments are valid for C##.
One argument for java (and C##) is that their object-oriented concepts are much "cleaner" than the ones in C++. With C++ you can do really nasty things, consider void pointers and the memory management as two examples. C++ gives you great freedom which means great possibilities..or great danger...
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

There's already been about 3 topics that have been jacked for this purpose, you want to start another discussion about it :D
Guest

Post by Guest »

you are rigtht, actually I wanted to reply in one of those threads but then I was too stupid and clicked on new thread instead of reply...
......silly me :oops:
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

np, I was only joking anyway since I was the centre of most of em.

I know Java has a use and a place, but most of other peoples arguements seem to consist of "Java is great, how dare you say Java is just an offshoot of C". Fact is that Java was conceieved from C, they took the idea, used it for a very simple application and it is grown from there. It may well be faster now, it may well be closer to Assembly language now but it is still behind C++ ( from actual research I have done into the two languages, the thing even people use it have failed to do ) in the way it goes about things. From what I have found, Java is great for web applications and a few other things but it simply isn't as suitable for large scale projects such as game projects.

The only "proof" I have seen to the contray ( this includes more than this forum as well ) is someone here saying that the flying game IL2 was written partly in Java ( which I have confirmed from looking at the DLL's, not sure how much was witten in Java ). That's the game that eats system performance to do very little, the game that is slow even with all the settings down to minimum. Great endorsement! I don't mind Java, but I still think ( with a lot of others ) that it simply isn't on the same level as C++ and quite possibly will never be.

I think the arguement about C++ being really advanced but possible to really screw up are one and the same. You can take away all those dangers but by doing so you are probably going to take away the versatility of the language.

C# is interesting, however I don't know many projects are actually using them. I think if something like Q4 or HL3 will use it then other developers will be forced to learn it but until a widely used engine decided to convert I can't see it taking off. I don't really know enough about it but it seems like an easier to use version of C++, much less code to do the same things and a some additional features.
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

I don't know a single thing bout coding...but working as gfx man at company , and the meals with mates were quite clear bout it...all crys and laments for using Java and not c...or c++.While they all were java freaks.Just making something like moving huge pixels in screen, even in 2d, was WAY slower, specially in Linux...for some reason, for then (a year ago or more) the windows java thing was faster in redrawing... even so, slower than a c compiled dx game in pc...

There are of course limits limited with hardware, but basicly, they could not get very low for performance and not breaking compatibilty and dunno what more things...also for the way java works...yets so, was better for them for having all coed organzied and all, seems is extremely good for much stuff; not so good for full blown pc-like games...

There's some engines in Java, that seem doing good...Can't remember the names...

I think they use libraries, based in open gl...JOGL, and LWGL (lightweight library or something) ...soe there's this low level access library, and then game engines...basicly I was seing one as the best , dunno the name now...

but there are some. I am told it always depend if u compile for an specific machine using certain compilers (kafee?) but then u loose compatiblity and dunno what else.

eck.What the heck is a gfx person doing answering here...
Finally making games again!
http://www.konekogames.com
etcaptor
Posts: 871
Joined: Fri Apr 09, 2004 10:32 pm
Location: Valhalla
Contact:

Post by etcaptor »

I don't know for C#, but in Java is security related restriction for inheritating from only one base class.
For me C++ is for now the best language.
buhatkj
Posts: 444
Joined: Fri Dec 12, 2003 4:53 am
Contact:

c++ advanced features are part of the speed...

Post by buhatkj »

c++ gives the coder the ability to access anything, with a minimum of rules. Its like the code equivalent of ROOT. part of what makes it so fast is the ability to do thoroughly unwise and low-level memory things like "delete" and "memcopy" (which both to be honest, are really carry-overs from c, in fact stroustrup advises AGAINST using things like this in "the c++ programming language", and encourages coders to use OO style code as much as is possible because its is arguably cleaner and more fail-safe)
regardless of whether it is wise to use them, these things are possible in c++, and NOT possible in JAVA.

my issua with java, would moreso be about the lack of really good support for 3d avaiable. i have seen a few simple java OGL bindings, but none of them was very easy to use, most were also only partial and incomplete.

now if somebody figured out how to make a fully functional irrlicht binding for java, i might use it, but since i havent heard of one yet, i will stick ot c++ :-)
-ted
My irrlicht-based projects have gone underground for now, but if you want, check out my webcomic instead! http://brokenboomerang.net
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

Chrome was written in Java and it's a latest generation kind of game. Its performance is flawless and they got huge outdoor levels full of vegetation and oceans and stuff.

I'm not saying Java is better, but that there's another stream of programmers who have already gone far in 3d graphics with java.

http://www.chromethegame.com/en/index.html
Image
warui
Posts: 232
Joined: Wed Apr 14, 2004 12:06 pm
Location: Lodz, Poland
Contact:

Post by warui »

Chrome wasn't written in Java. It uses it only as a scripting language.
Tomasz Nowakowski
Openoko - www.openoko.pl
Jedive
Posts: 146
Joined: Wed Apr 28, 2004 5:51 pm

Post by Jedive »

Didn't know C## has been released lol
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

so Chrome is C++ (+) Java?

didn't know

so what r all those java scripts for?
Image
Bunnz

Post by Bunnz »

C# is a really great language and fast enough to write great games.
Although I know that C# has still a few weak points, I'm convinced that in a few years C# will be used for many games :wink:

Have fun and greetings to Niko,
Bunnz

Visit: http://purplesharp.sourceforge.net
Purple# - a shader driven 3d engine for .NET
warui
Posts: 232
Joined: Wed Apr 14, 2004 12:06 pm
Location: Lodz, Poland
Contact:

Post by warui »

> so Chrome is C++ (+) Java?
> didn't know
> so what r all those java scripts for?

For scrpipting ;) It is used for such things as models information, AI procedures, mission scripting and more.
Tomasz Nowakowski
Openoko - www.openoko.pl
Post Reply