Java Reference
In-Depth Information
These features provide a number of benefits compared to program development
in other languages. For example, C/C
programs are beset by bugs resulting
from direct memory pointers, which are eliminated in Java. Similarly, the array
limit checking prevents another common source of bugs. The garbage collector
relieves the programmer of the big job of memory management. It's often said
that these features lead to a significant speedup in program development and
debugging compared to working with C/C
++
++
.
1.5.1 Java features and benefits for technical programming
The above features benefit all types of programming. For science and engineering
specifically, Java provides a number of advantages:
Platform independence - Engineers and scientists, particularly experimentalists, prob-
ably use more types of computers and operating systems that any other group. Code
that can run on different machines without rewrites and recompilation saves time and
effort.
Object-oriented - Besides the usual benefits from OOP, scientific programming can
often benefit from thinking in terms of objects. For example, atomic particles in a
scattering simulation are naturally self-contained objects.
Threading - Multiprocessing is very useful for many scientific tasks such as simulations
of phenomena where many processes occur simultaneously. This can be quite useful in
the conceptual design of a program even when it will run on a single-processor machine.
However, Java Virtual Machines on multiprocessor platforms also can distribute threads
to the different processors to obtain true parallel performance.
Simulation tools - The extensive graphics resources and multithreading in the core Java
language provide for depicting and animating engineering and scientific devices and
phenomena.
Networking -Java comes with many networking capabilities that allow one to build
distributed systems. Such capabilities can be applied, for example, to data collection
from remote sensors.
Interfacing and enhancing legacy code -Java's strong graphics and networking capa-
bilities can be applied to existing C and Fortran programs. A Java graphical user interface
(GUI) can bring enhanced ease of use to a Fortran or C program, which then acts as a
computational engine behind the GUI.
1.5.2 Java shortcomings for technical programming
Several features of Java that make it a powerful and highly secure language,
such as array limit checking and the absence of direct memory pointers, can
also slow it down, especially for large-scale intensive mathematical calculations.
Furthermore, the interpretation of bytecode that makes Java programs so easily
portable can cause a big reduction in performance as compared to running a
Search WWH ::




Custom Search