Java and JavaScript have received a lot of attention recently. Much of this can be attributed to large-scale marketing efforts and licensing agreements by Sun, NetScape, Microsoft, et al. Java does bring some interesting technology to the Web, however, and it is clear that Java (and/or Java-like) languages will play a large part in the development of the Web over the next few years.

By downloading code into the client program, Java and JavaScript allow the client machine to do arbitrary amounts and kinds of local processing. The client can handle application-specific data formats, present specialized (and highly interactive) user interfaces, or allow local processing and display of downloaded information.

Of course, none of this is free. Because arbitrary client environments must be supported, the downloaded code must be interpreted or compiled by the client machine. The interpreter must also authorize requested actions to protect the client machine from buggy or malicious code.

All of this interpretation and checking takes time. Consequently, Java (let alone JavaScript) is unlikely to run at anything like the speed of a native compiled application. On the other hand, the added functionality and reduction in communication delays may more than compensate for the differences in compute speed.

Java

Java is a compiled language, based on C and C++. The output of the Java compiler is a set of instructions for a virtual machine. The instructions are typically executed by an interpreter that resides inside a WWW browser. Java enforces a consistent virtual architecture, allowing it to run on any kind of client machine.

Most programmers will face few hurdles in learning Java. Java borrows a few object-oriented notions from C++, but it is really a lot closer to ANSI C than to C++. Consequently, the learning curve for C programmers will be particularly short and gentle.

Java's object-oriented features are not difficult to use. Its strong typing and architecture neutral data types require only a small amount of discipline. The somewhat peculiar set of library functions (classes, really) is likely to be the biggest hurdle. Because Java must run inside a browser on an arbitrary platform, many conventional C library functions simply aren't available.

Getting Java

http://www.javasoft.com/ is the center of the Java universe. It contains documentation, downloading information, pointers to other sites, and much more.

The site offers several kinds of Java software, serving a range of user and programmer needs. Prospective Java programmers will want to get copies of the Java Developers Kit (JDK). This contains an Applet Viewer, a Compiler, a Runtime system (interpreter), and some preliminary debugging tools.

Sadly, the JDK only supports a small set of environments at present. The site lists (SPARC) Solaris 2.3 or higher, (Intel x86) Windows NT/95, and the Macintosh. The site claims, however, that the JDK will soon be released in source form. This may allow adventurous programmers to attempt ports.

The browser situation is a bit more complicated. HotJava(tm) is a modular, applet-aware, extensible World-Wide Web browser written entirely in Java. The browser, now in an alpha release, is not intended to have the full functionality of a finished commercial product. It does, however, demonstrate the concept of executable content.

So, even if you get HotJava, you should probably pick up a copy of Java-enabled Netscape. The Netscape home page (http://home.netscape.com/) will lead you to the appropriate downloading information.

While you're getting the software, don't forget to pick up some documentation. There is quite a bit of freely available Java documentation on the Javasoft server. There is also a slew of Java books about to hit the market. By press time, I estimate that there will be more than a dozen Java books in print.

JavaScript

JavaScript, a Java-based scripting language, is even more experimental than Java. It is certainly worth a look, however, as it offers a rapid and comparatively easy way to develop client-side Web software.

JavaScript code is downloaded in source form, embedded within the relevant HTML page. Functions are generally defined in the HEAD portion of the document. Event handling code is then laced into appropriate parts of the BODY. Because the JavaScript code is hidden within HTML comments, a non-JavaScript browser will simply ignore it.

JavaScript has access to a large set of methods, allowing it to perform a large range of tasks. For very specialized or compute-intensive tasks, programmers are encouraged to write additional methods in Java.

To get more information on JavaScript, start at http://home.netscape.com/comprod/products/navigator/version_2.0/script/. This leads to a large number of demonstration servers, documentation, and other useful Web resources.