Originally posted by StratComm
Because we're inately talking about graphical applications here. Java's dependancy on a virtual machine, no matter how optimized its bytecode is, fails pretty miserably in comparison when making system-dependent calls to graphics packages. Java is never faster than properly optimized C/C++ either, if just because of its garbage collection.
But graphical applications are a very small subset of all applications, which is my entire point. In fact, graphical engines are a subset of the requirements for games, too.
IMO it's probably most valuable in any situation to have an understanding of the design principles rather than a specific language fluency.
Albeit I believe Java graphics performance is signficiantly improving thanks to DirectX / OpenGL bindings (through several methods IIRC; including direct interface bindings and the Java3d APIs); whether or not it can attain an acceptable performance vis-a-vis C/C++ is a different matter, of course. (The JOGL binding API is unfortunately pretty poorly documented at present, natch, so I'm not sure if direct comparative work has been done)
I would agree that Java is slower, but IMO that would be beside the point - my personal attraction to Java is the portability. Not so much in terms of moving between different platforms, but in terms of mobile running code. I think that will be of major use in future, and I'm not sure C++ is as suited - AFAIK all the major mobile agent programs/frameworks use Java (albeit in some cases also a modified VM in order to allow persistant state between transfers).
EDIT; actually, this is interesting. I'd still venture that C/C++ is more innately optimizable (despite my limited experience in both of those), but I never realised the apparent closeness.
http://www.idiom.com/~zilla/Computer/javaCbenchmark.htmlhttp://www.javaworld.com/javaworld/jw-02-1998/jw-02-jperf_p.htmlhttp://www.tommti-systems.de/go.html?[url]http://www.tommti-systems.de/main-Dateien/reviews/languages/benchmarks.html[/url]
Originally posted by StratComm
EDIT: One normally doesn't care much about the speed of memory management in a strictly computational, low-level environment, and so it is rarely optimized to that end. That's where Java's apparent strength lies; it allows you to write more complex non-graphical programs, especially from a beginner perspective, without actually needing to worry about closing up all of your memory leaks.
I'm not sure what you mean. Obviously the speed of memory management and the efficacy of memory use is critical in low-level situations, particularly with embedded C coding; if you mean that Java isn't suitable for that because it doesn't have an optimizable garbage collection system (i.e. slower), then I agree; I'd always prefer a low level control of memory allocation on sparse or efficiency crucial environments.
My point is that the lack of garbage collection / pointer tracking responsibilities for the programmer should not be regarded as a 'deficiency' in the usefulness of Java, but a difference. Same for much of the differences between languages; Java is slow due to an abstraction layer, but it's more - natively - portable in both a static and dynamic sense. (Obviously you can port C++, but AFAIK you'd have to either make hardware level optimization changes, or ignore that very benefit to make the code portable. and even if you use libraries to abstract that, there's still the issue of how many platforms all those libraries cover - especially with small mobile systems)