Re: C++ Speed Vs. Java
Mirek Fidler wrote:
James Kanze wrote:
Sun currently
invests a lot more in the internal compilers in their JVM than
they do in their C++ compiler, and it shows in the relative
performances of the two.
The advantages of C++ lie elsewhere: if I'm doing a quick GUI,
Java beats C++ hands down
Only because Sun invests so much more time to develop (and advertise!)
GUI for Java than for C++.
Because Java has a fairly well designed standard GUI, yes. Also
because the typical Java development model is rather tuned to
such programs (as opposed to large scale, critical
applications).
And I agree that if Sun had invested in C++ anywhere near the
amount they've invested in Java, we'd have a lot better language
as well. I certainly wouldn't mind a standard GUI library as
complete as Swing for C++.
The fact remains that for whatever reasons, they didn't.
While comparing apples to oranges cannot be quite fair,
That's the real problem, I think. Java's actually quite good
for one or two niches; C++ tries (and IMHO succeeds) to be more
generalist. So while Java may be better than C++ for the GUI
interface, and C++ better than Java for the large, critical
server that I work on, I could do the GUI (fairly well,
actually, even if it would require more work) in C++, where as I
couldn't even consider Java for the server. The Java model is
too specialized, and doesn't scale, or port to domains for which
it wasn't designed.
All of which has nothing to do with the original question, which
was the relative performance:-).
this example
demonstrates that with a good library (biased opinion), C++ is quite
competitive with Java while solving GUI problems:
http://www.ultimatepp.org/www$uppweb$vsswing$en-us.html
The problem is that I've got to go and find that good library,
and install it, and train my collegues (and myself) to use it.
All without being sure that I'll be able to use it in the next
company I work for. Standardization does have its advantages.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orientie objet/
Beratung in objektorientierter Datenverarbeitung
9 place Simard, 78210 St.-Cyr-l'Icole, France, +33 (0)1 30 23 00 34
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]