When to use Java (and when not to)
Java is being used more and more to implement market trading
platforms, market models and quant research software.
Why Use Java
As a language Java is not substantially different from C++. What makes Java a much better choice than C++ in many cases is not the underlying language but the software environment.
- Java is truly portable. The same Java program will run on both Linux and Windows. This is not true of C++. C++ is a huge and complicated language and no two compilers from different sources implement the language in the same way. Only testing can assure that a C++ program will run across platforms. The lack of portability makes it easier to get locked in to a particular platform (for example, Windows), which reduces the options for system deployment.
- The software libraries and software components (like web servers) that are available for Java represent the largest body of reusable software that has ever been created. C++ cannot does not come close. These software packages are all free (no license fee and the source code is frequently available).
- The development environment for Java is excellent. The most commonly used tool is called http://www.eclipse.org/. Eclipse has a steep learning curve but once you get past this, Eclipse is a great development enviroment.
- Java integrates very closely with the so called "Web Services" environments which allow distributed applications to be created and managed much more easily.
- Java has very good Database support
- Java has very good networking support
Why Not to Use Java
- Applications that are entirely bound by CPU time and need to be as fast as possible should be written in C++
- Applications where a virtual machine (like the Java Virtual Machine, JVM) would not really work well. For example, the underlying database engines for database systems.
- Software that has to interface directly to the hardware (operating systems)
- Language processors that have to be fast (e.g., compilers)
These applications represent a small fraction of the software and in most cases I would use Java. I would, by the way, not use C. C++ has many advantages and has performance that is the same or very close to C.