A caffeine fix for the Web
BACK at the beginning of the Internet, Unix machines programmed mainly in C dominated.
This meant that applications were (usually!) portable - they could be run on a wide range of computers without being rewritten for each one.
The programmer's "source code" was compiled, or translated automatically, into the most efficient form for the computer. To run it on another computer the same source code would be recompiled for another machine. Then the PC and the Mac arrived on the scene, and suddenly portability was a big problem. A program which ran on one machine might not run on another.
The arrival of the World Wide Web, and the subsequent surge of interest in the Internet, emphasised this compatibility problem, crystallising the need for portable applications. Just think: a programmer creates a neat Web application which runs on his PC, compiles it, and puts a link to it on a Web page. Only people with PCs can use this link on the Web page, because the program has been compiled for a PC only. So the programmer has to include versions for every platform around.
Back in the early 1990s, a team led by James Gosling at Sun Microsystems realised this problem. In response they developed a new programming language called Java. It is an "object-oriented" language, but more importantly for Internet programmers it is also a portable language.
Its portability stems from its reliance on an interpreter. Every Java program is compiled into a common code, called byte-code, whether the compiler is running on a PC, Mac, or Sun computer. Every machine which wants to run Java programs has to have an interpreter for this code. So as long as your machine has an interpreter, it can run precompiled applications. Portability is no longer a problem!
The power of this portability becomes clear when you use Java in conjunction with a Web interface. Such Java programs are known as applets. An applet is a chunk of Java code that is embedded in a Web page by the introduction of a new HTML tag,