Jump to content

  • Log In with Google      Sign In   
  • Create Account

Java or C++?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • This topic is locked This topic is locked
44 replies to this topic

#41 Telastyn   Crossbones+   -  Reputation: 3726

Like
1Likes
Like

Posted 22 March 2012 - 12:43 PM

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.

Sponsor:

#42 SimonForsman   Crossbones+   -  Reputation: 6107

Like
0Likes
Like

Posted 22 March 2012 - 12:59 PM

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 Posted Image

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)
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!

#43 JWBaker   Members   -  Reputation: 235

Like
0Likes
Like

Posted 22 March 2012 - 01:00 PM

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.

#44 Storyyeller   Members   -  Reputation: 212

Like
0Likes
Like

Posted 22 March 2012 - 01:05 PM

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.

#45 rip-off   Moderators   -  Reputation: 8210

Like
0Likes
Like

Posted 22 March 2012 - 01:07 PM

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.

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.

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

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS