Click to See Complete Forum and Search --> : Java vs. C++


October 13th, 1999, 08:17 PM
I would like to know why most applications are developed in C++ instead of Java since Java is simpler than C++. Anyone?

dcturner
October 14th, 1999, 03:30 AM
Java runs on a Virtual Machine, which is a platform- and architecture-neutral hypothetical computer which can, in theory, be emulated on any computer. This puts a number of restrictions on what the VM can do. If you are writing a program for Windows, say, you cannot access the native Windows API calls from Java (ok, it is possible but it takes a lot of work), and in doing so you remove the platform-independence of Java. C++ gets round these restrictions by compiling to the native machine code of whatever computer you compile it on so it can access any API directly.

Also, because C++ compiles to native code whereas Java compiles to VM bytecode, which then has to be interpreted by a VM, C++ requires very little overhead and runs faster than an equivalent Java application.

I must say that I don't find C++ a lot harder than Java. Some of the intricacies of MFC are tough, but once you get them it's just as easy as AWT, and for command-line utilities the two are much the same. C++ has some very nice features which are not implemented in Java, such as generic classes and operator overloading.

Hope this has been some help!

Dave Turner