Advantages and Disadvantages of Java

Team-Fly

Java is best known for its ability to execute programs on computers over the Internet. Through the World Wide Web, programs can be downloaded to a user's computer; these programs, known as applets, can be used to create animation, figures, forms, and other functions that make a Web page more functional. Though enhancing user interfaces is an important area for Java, the language is also used to develop entire applications and is also now becoming a common gateway or portal tool for systems integration.

By design, Java is platform independent; this is one of Java's strongest advantages over other languages. If you program something in C or in most other languages, the compiler translates your source file into assembly instructions that can be read and executed only for the processor on which your computer is running. Java gets around this problem by compiling your source code into instructions that can be read and executed by a program commonly referred to as the Java interpreter, Java Runtime, or the Java virtual machine. Therefore, as long as a hardware platform has a Java interpreter, it can execute any Java program. As more Internet technology is developed, the use of Java will no doubt increase. Consider the emerging technology of Web appliances, which will rely on many different processor chips. Anyone who wants to write software to execute on these platforms will undoubtedly use Java, because it is becoming the standard. Every processor/operating system in this new arena is sure to include a Java interpreter.

Another key advantage of Java is that it is built with security in mind. This feature is not necessarily true for other programming languages. If you execute a Java program from the Internet (an applet), the program can neither write to files on your computer nor connect to Web servers other than the one on which it has been stored. In addition, restrictions prevent applets from executing other programs on the computer on which they are executing, and applets cannot define native methods.

Because Java is an OOP (Object-Oriented Programming) language, learning it is relatively easy for programmers who are used to other OOP languages, such as C++. This feature is important because C++ is currently the second most popular programming language, and experienced programmers need an easy migration path to move from C++ to Java.

Java, however, does have some disadvantages that hinder its acceptance in some application development areas. The first drawback, or perceived drawback, is Java's relative slowness of execution. Remember that Java programs are platform independent; therefore, the interpretation of the Java programs by the Java interpreter is a step that programs compiled with C and other languages do not require. Better Java interpreters, just-in-time compilation of Java programs, and overall better hardware and communication software have made execution speed much less of an issue than it has been in the past.

Another potential problem is version control. When new major releases of Java are introduced (such as Version 2 recently), not all machines are immediately ready to run the newer features of the language. If you want your program to run on all platforms, you must stick to using the older version of the language until the newer version is widely accepted. However, this issue is relatively minor: New versions of Java do not come out that often; in addition, developers of the Java interpreters are now getting their new releases out faster.

Java versus Visual Basic

Visual Basic is currently the preferred programming language for global applications. Visual Basic is an object-based language; Java, as you've learned, is an object-oriented language. As you will see later in the book, an object-oriented approach allows you to create an object and then use that object in multiple places. With Visual Basic, programmers are severely limited in their ability to use a precreated object in other areas of their programs.

Visual Basic does not support other features that make for a truly robust programming language. Some of these features include threads, full network capabilities (such as HTTP and sockets), and true exception handling. Another drawback to Visual Basic, in my opinion, is that it ties you to a sole supplier, Microsoft. Though Microsoft's products are good, Visual Basic applications must run on a Microsoft operating system. At a large corporation, this restriction limits your future choices and increases your development time if you should want to expand to other systems, such as Linux.

Java versus C/C++

For convenience I am going to combine the C and C++ worlds, even though C is not an object-oriented language. When you compare Java to C/C++, you will see that Java does not support some of the features that C/++ does. One of these features is the concept of pointers, which means referencing one memory location in a program through another memory location. C/C++ programmers love this concept. It allows them to write very powerful programs with few lines of programming; however, it also opens a large security hole, which is one of the fundamental concepts that Java addresses. Another disadvantage of pointers is that their use makes it very easy to introduce subtle bugs into a program. In my opinion, the lack of pointers in Java generally results in programs with far fewer bugs than similar C/C++ programs have.

Another feature that Java does not support is multiple inheritance. This feature of C++ is useful, but it also introduces many complexities. The designers of the Java languages chose to avoid this added complexity by using the concept of interfaces. The interface approach may not be quite as easy or elegant as multiple inheritance, but it does make code less complicated.

C/C++ has several other features that are not included in Java (such as operator overloading), but in general Java has all the commands and features that are necessary to write any standard business application. Because Java does not include every C/C++ feature, Java code is relatively simple to read, which from a pure business standpoint is good news. Simpler code should reduce overall code development and maintenance costs. You should also realize that a significant amount of IT cost is devoted to supporting existing applications. Code that is simple to read and that avoids complexity will ultimately be less expensive to support.


Team-Fly


Java & BAPI Technology for SAP
Java & BAPI Technology for SAP
ISBN: 761523057
EAN: N/A
Year: 1998
Pages: 199

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net