How faster is C++ compared to Java ? I tryed asking this at offical java forum but they deleted my thread...
Printable View
How faster is C++ compared to Java ? I tryed asking this at offical java forum but they deleted my thread...
Do you realize that what you are saying is inflammitory?
http://72.14.203.104/search?q=cache:...s&ct=clnk&cd=1
http://www.kano.net/javabench/
Probably marginally faster, considering C++ has 3 characters compared to 4 characters for Java.
> How faster is C++ compared to Java ?
http://www.albionmich.com/inspiratio...licompare.html
How about just picking the right tool for the job?
Your question is about as meaningful as which is better, a hammer or a screw-driver.
Why do you keep asking?
http://cboard.cprogramming.com/showthread.php?t=77811
the university im planning on going to next summer only teaches Java. unfortunately.
For what kind of degree? Only Java?
At my university, Java is taught first, then C++; from there its the students job to learn other languages (besides obvious cases).
The point is: a programming language is a tool, nothing more. You simply need to decide which tool best suits the problem at hand(Java, C++, Python....whatever)
The speed that a language works is not that important, apart from perhaps game code, where as well written C++ programs can be lightning quick
One thing I find wierd is that in my computer science course they start with java, then end up doing all the top tier classes in C++ (with the exception of programming languages which teaches several)
I vote to lock or delete this thread. The original question was asinine and now it's totally derailed.
It maybe that learning Java would give you a solid foundation for moving on to unserstanding C++. Personally, I had no interst in Java. I am not knocking it, it is a good language with many uses, but C/C++ was more what I needed. When I left school in 1997, I learnt a small C course but then took to learning C++ in my own time.Quote:
One thing I find wierd is that in my computer science course they start with java, then end up doing all the top tier classes in C++ (with the exception of programming languages which teaches several)
> but they deleted my thread...
There's 4 religions out there.
- One considers any question like this inflammatory. Followers of this religion usually are secret believers of one of the next two religions.
- Two other religions have an answer to that question. And they stick to it!
- The forth and last religion know there is no answer. Atheists! But damn me if they aren't the smart ones.
The better question would be "I have the following requirements for foo, what might the pros and cons of a Java or C++ implementation be?".
> I vote to lock or delete this thread.
We'll see what ElastoManiac's first rebuttal to the arguments are....
ok, I'll openly admit I'm in one of these two religions :DQuote:
Originally Posted by Mario F.
in all seriousness, Java is slower in execution for a number of reasons, not the least of which is the jvm.
add that you have to build the framework for your object, every time you want to use it, in java and you have bloated code to start with.
[ essentially, java requires scaffolding around every object in the code to support the code from falling over itself ]
a program in C++ can be badly written, with tons of bloat and perform slowly as well, but C++ does not require such bloat as java does.
the jvm issue isn't that it's needed, it's that there is more than one.
sorry, eclipse framework to support multiple jvms is just more bloat in the language, not a smart choice.
it's a cop-out, and the eclipse team should all be shot for stupidity.
hence the reason why many beginner programmers would choose C++ over Java. Especially for games ( being that was their ideal aim )
Now that paragraph didn't really make sense. What has Eclipse to do with the language?Quote:
Originally Posted by Jaqui
Quote:
Originally Posted by Jaqui
huh? Do you mean more than one JVM instance, or more than one vendor? If you mean more than one vendor than yes, that is a problem. No 2 JVMs are the same. If you mean more than one instance, than you don't understand how Java works :p
Eclipse doesn't have a "framework to support multiple jvms" afaik, and it definately isn't part of the language. Don't drag eclipse into this, it's a great piece of software, many developers (Java and C++ alike) could learn a lot from it's design. Your ignorance just demonstrates your lack of understanding.
nope, eclipse is a java based tool to develop in java.
it's primary benefit being support for multiple different jvms.
the c++ tools in eclipse are all written in java.
and every time I take distro supplied eclipse installers and install eclipse, it fails.
[ gee, like microsoft office not installing on windows, not impressive for the application or company ]
yup, every distro I have looked at I have tested the eclipse install, they have all failed to install a working version of it.
[ yet another proof java is broken beyond usability, the "end all and be all" dev tool doesn't install.
Hmm that is odd, I have never had any problems installing Eclipse, I had a couple problems with a couple plug-ins for it, but I found out that it was my fault and not the plug-in's fault. I typically don't use distro-provided software other than the base operating system and sometimes the drivers.
Eclipse is a Java-based application infrastructure. The Eclipse Platform is a generic development environment.
The Java Development Tools are the Java IDE, just like the C Development Tools are the C/C++ IDE.
By distro-supplied Eclipse installers, do you mean Linux distros? So how is that Eclipse's fault? Eclipse's own installer works flawlessly. The program's main issue is that if it's installed to a cross-user directory, it takes an admin to install or upgrade plugins, which is the actual reason I don't use Gentoo's Eclipse ebuild (which otherwise worked flawlessly, I might add).
And Eclipse's primary benefit is not supporting many JVMs. I still don't even know what you mean by that. Being installable in different versions? Others can do that. Compiling for multiple versions? Others can do that, too. Compiling for VMs by different vendors? Actually, JVM differences manifest themselves in different runtime characteristics; other than that, all programs run the same unless they use some vendor-specific functionality (such as com.sun.* or sun.* classes).
Eclipse's primary benefit is its excellent design and thus the many great plugins available for it, including the extremely good Java editor, code refactorer, source completer, etc.
And all of this has nothing to do with Java, so stop your pointless ranting.
What exactly is a code refractorer. The most I've used it is to rename classes and it changes all references throughout the code to the class. Is there more to refractoring?
It can move methods through the hierarchy, classes to other packages, rename methods, variables, extract string literals into constants or resource files, all that stuff. And it can do it without introducing errors in your code, which is more than can be said about most manual refactoring.
> Is there more to refractoring?
A lot more. Ultimately refactoring is about changing your code without affecting its behavior. It's not about changing your code to fix bugs or alter its behavior.
At the simplest level it can be about changing one variable name to something more readable or understandable, and at the most complex level changing your whole hierarchy structure. You refactor all the time when writing code without a strict specification behind. However, the key point behind this abstract concept is that you only do it when you don't alter your application behavior.
EDIT: I would probably add that not altering your application behavior, but improving its performance is not what refactoring is about either.
PEBKACQuote:
Originally Posted by Jaqui
>if it's installed to a cross-user directory, it takes an admin to install or upgrade plugins,
Actually you can install plug-ins into user defined directorys, independant of the eclipse install location. You just select "Add local site" or something during the install wizard.
+1 on eclipse's refactoring tools. Absolutely superb.
Yes, but my installation wanted to register them in some file that lies in the main installation directory. And as a normal user I don't have write access to that file.Quote:
Originally Posted by Perspective
hmm, thats odd. I've never had that problem with the Fedora distro,Quote:
Originally Posted by CornedBee
Well, if I remember correctly, I got that ebuild from an experimental overlay, so that may have been it.
Why do you even care? Are you actually having trouble with Java being too slow?Quote:
Originally Posted by ElastoManiac
You never curious about things?Quote:
Why do you even care? Are you actually having trouble with Java being too slow?
Disclaimer: I've programmed in both C++ and Java for quite a few years. In fact, I code J2EE applications for a living now.
In my experience, for speed, C++ is definitely the winner here. Java is written in C++, so theoretically it can't be faster than C++. Plus, Java adds a lot of baggage like runtime array bounds-checking, instead of compile-time assert() checking, runtime generics instead of compile-time templates, etc.
BUT HOLD ON! It can be faster than other less well-written C++ apps.
Java is noticeably slow on Windows PCs during startup, and for Swing GUIs and applets.
BUT HOLD ON! On Linux, Swing seems to perform much less poorly, and by using the non-standard SWT over Swing, desktop apps seem to improve remarkably in speed and native look-and-feel.
The College Board's Advanced Placement curriculum for computer science (highschool) recently switched from using C++ to using Java. I don't know whether that's because it is a more ideal language to teach (as I would imagine), or because someone thought that Java might outlive C++. Total derailment -- just thought I'd chime in.
Die thread die!!!
<gunshot> and the thread lies motionless.