The Jive on Java

Make most of Java by cutting through the myths behind its origins.

George Watson

January 31, 1997

5 Min Read
ITPro Today logo in a gray background | ITPro Today

Since its public introduction a little more than a year ago, tremendous hypeand fanfare have surrounded the Java programming language. Rumors, speculation,and confusion have all followed the wave of Java publicity. Is it secure? Is itjust for the Web? Is it robust? As Windows NT 5.0 takes shape, Microsoft ispreparing an important place for Java and other Web-related technologies (forinformation on NT 5.0, see the list of related Windows NT Magazine articleson page 116). To understand Java for what it is and what it isn't, you have toknow a little bit about Java's origins and cut through the myths.

Java's Reason for Being
Java is a general-purpose OOP language, but many users associate it with theInternet. The Internet connection came relatively late in Java's gestation andwas not its original purpose. Sun Microsystems developed Java while working onprojects for intelligent appliance such as personal digital assistants. JamesGosling led the development group, which started its work in C++, but becamefrustrated with some of C++'s limitations.

Beginning in 1990, the development group began working on a new language,the Object Application Kernel (OAK). Because OAK was already a registered tradename, Sun Microsystems renamed its new language Java. Like most technologydevelopments, Java has origins in other languages. C and C++ contribute themost, but Smalltalk, Objective-C, Eiffel, Ada, ML, and SNOBOL also have elementsin Java.

Various technologies claim to compete with, complement, or associate withJava. For example, Netscape's JavaScript is unrelated to Java the language, butboth products carry a similar name. Microsoft positions its ActiveX componentsto compete with Java, but ActiveX is not a programming language. The truth isthat nothing is quite like Java.

Truth About Java
Many claims have been made about Java as a language. By examining theseclaims, you can begin to better understand Java's place in the world ofdevelopment technologies.

Simple. Java is the simplest OOP language to learn. Bycomparison, the learning curves for other OOP languages such as C++ and non-OOPlanguages such as C are very steep. What will happen to Java after the standardscommittees take hold of it is difficult to say. Despite its simplicity, Java isan OOP language, so you need to gain some understanding of object-orientedconcepts.

What it is, and what it isn't

Efficient. The claim that Java is efficient is debatablebecause Java is an interpreted language, and the Java interpreter uses the JavaVirtual Machine (JVM). You can interpret Java to run on any operating system orWeb browser, so a Java program will typically run between 2 and 20 times slowerthan an equivalent C++ program. However, for an interpreted language, thisperformance is considered efficient.

Several companies (including Borland and Symantec but excluding SunMicrosystems) recently deployed a relatively new concept to help with Java'sruntime efficiency: Just-In-Time (JIT) compilation, which involves invoking acompiler at runtime from within the JVM on precompiled Java byte codesthat have had all dynamic bindings resolved. The JIT compiler re-compiles theinterpreted byte codes into machine code, which speeds subsequent execution.Technologies such as JIT, advances in general-purpose computing hardware such asthe Pentium Pro, and the Sun Microsystems announcement of Java silicon(processors that execute Java directly) will make Java a more effectivegeneral-purpose computing language. The first examples of Java silicon and theJavaStation are due out in 1997.

Small. The Java language is small. The number of keywordsand language constructs is limited compared with other development languages.The compiled code that Java produces is also compact relative to the number ofinput source lines, which makes it good for quick downloading across theInternet.

Architecture Neutral. Java's language characteristics areabsolute across all platforms, which makes Java programs extremely portable.Java does away with the 16-, 32-, 64-bit conundrum because the basic data typesare the same size regardless of platform. So, for example, you can write a Javaprogram on Windows NT that will run on a Solaris SPARC machine without so muchas a recompile. This portability includes graphics programs. Anyone who has hadto architect and construct portable graphics code, even with a helper toolkit,will appreciate Java's portability.

Secure. Java's claim to be a secure language is in disputebecause hackers have successfully cracked its security mechanism dozens oftimes. Sun Microsystems is revising Java to use independently verifiable digitalsignatures to enhance Java's security. These enhanced features will be part ofthe next major release of the language.

Robust. Several of Java's elements make it one of the mostrobust languages ever developed. Because Java has no undefined states, you'reless likely to encounter a protection fault or clobbered memory. In contrast,when a program written in C or C++ references a pointer to an invalid memorylocation, the language does not define what action to take and the program canbecome unstable. Java also has a well-designed exception mechanism that performsmany checks at compile time. The exception mechanism can catch and easily handleruntime exceptions. In addition, the lack of pointers combined with extensivecompile time analysis eliminates many traditional coding errors, making for verysolid code.

Multithreaded. Java contains embedded support formultithreaded programming. Some of the support is in the language in the form ofkeywords supporting mutual exclusion locks and semaphores, both of which arenecessary for effective multithreaded programming. Some of the support is in theclass library that comes with the language. Although multithreaded programmingis inherently difficult, Java's support for it makes it simpler than ever beforeby providing an easy-to-use language and library mechanisms.

International. All character and string data types in Javaare Unicode. Unicode is a standard that supports wide characters capable ofrepresenting any one of the natural languages (you can find complete informationabout Unicode at http://www.unicode.org).

Java's Future
Because of its presence on and off the Web, Java is aiming to become adominant application development language in the next few years and figures toplay an important role in NT 5.0. The application development community,including NT development shops, will largely determine Java's success. For moreinformation on Java, see the box, "Java Resources."

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like