Java or C++?

Started by
43 comments, last by rip-off 12 years ago
I think that Java is good enough for most applications on a modern system. However, if you are doing something that is low level or requires extreme performance, Java is out of the question. For example, I'm not aware of any GBA homebrew games written in Java.
I trust exceptions about as far as I can throw them.
Advertisement

And if Java is so good, it would've been used for coding commercial operating systems


Ignoring the absurdity of that metric as a measure of what denotes a 'good' programming language, the non-kernel bits of the Android OS are written in Java. I suspect other mobile OSes (you know... almost every commercial operating system made after the development of Java) also have a large bit of Java.

I think that Java is good enough for most applications on a modern system. However, if you are doing something that is low level or requires extreme performance, Java is out of the question. For example, I'm not aware of any GBA homebrew games written in Java.


The GBA doesn't have a JVM nor a native Java compiler so it would be kinda difficult smile.png

as waytolazy mentioned there is also a bit of a problem with managed languages on consoles, primarily because of the insanely low amounts of memory available. (The xbox 360 only has 512MB ram shared between CPU and GPU and no L3 cache (1MB L2 cache shared between all 3 cores) making memory management something of a problem), the situation on the GBA is even worse.

The PC on the other hand has tons of RAM and large chunks of cache available, while the L1 cache is still small and L2 isn't much bigger than on the 360 the large L3 cache greatly mitigates the cost of cache misses. (the latest core i7 has 15MB L3 cache in addition to the L1 and L2 cache making complete cache misses fairly rare even with a managed language (unless you work with large sets of data ofcourse) (having to fetch data or instructions from L3 is still slower than getting them from L1 or L2 ofcourse but nowhere near as slow as having to dip into RAM to get them as you frequently have to do if you're not careful on a console)
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!
Magicka was C#/XNA, so was terraria and ic heard Bastion was also. If you are wanting more speed than these games need, its likely not a 1 man hobby/indie project.
If you want a good basis for programming, i.e. have a driveto really learn it well and understand how things like Unreal are built. I think its good to grab a C++ primer book and go through it till you understand all about memory and pointers. Then move to C# to get things done relatively easy. If you need more power later on, move back to C++ and start learning its black magicks.
Well it depends on the type of game you're making. Most games don't require much performance, but if you want to do advanced AI or physics, then you can easily run into performance limitations, even in an indie game. Just look at Achron (made by only 2 people).
I trust exceptions about as far as I can throw them.
I was not pretending that Java (or any language) is a performance panacea. I was addressing particular misconceptions in the post by Ripiz. I'm not sure your rebuttals have any particular relevance to a beginner.


It's so easy to blame everything on implemention ... One could argue that the performance issues of C/C++ is related to implementation too.
[/quote]
My point was that you cannot write off technology based on the current implementation. A few years ago, many people dismissed dynamic languages as hopeless to optimise. Modern Javascript engines show that such an attitude is flawed in the medium and long term.

Yes, C++ compilers are not set in stone. They will continue to improve. That said, they've had a long maturation time, and are closer to the point of diminishing returns than younger technologies.


Regardless of whether or not the percentage is correct, you've admitted yourself that Java is an inadequate language, performance-wise.
[/quote]
For who? What purpose, what application?

Is it inadequate for a beginner's Pong clone? What about Quake? Or Minecraft? Crysis 3 would be a different matter. What about Doom 7 though - what will be in vogue then?

I was merely pointing to one concrete flaw that is exacerbated by the language itself, much like C++ has the aliasing problem. Some quick googling suggests that some research has been done into virtual machines that can do object inlining. I don't know if such changes are in the production JVMs, but if not this again points to implementation issues at heart - just the implementation must be more complex because it gets no help from the language.


And if Java is so good, it would've been used for coding commercial operating systems
[/quote]
Mu. I don't write Operating systems, I would wager that most people here do not write operating systems. Especially the beginners amongst us. I utterly reject this as a meaningful metric of a language's "goodness".

Whether there are 100 commercial operating systems written in Java, C#, javascript or even Basic, it is of no consequence.

This topic is closed to new replies.

Advertisement