Java Reference
In-Depth Information
the Internet! Instead, the primary motivation was the need for a platform-independent lan-
guage that could be used to create software to be embedded in various consumer electron-
ic devices, such as toasters, microwave ovens, and remote controls. As you can probably
guess, many different types of CPUs are used as controllers. The trouble was that (at that
time) most computer languages were designed to be compiled for a specific target. For ex-
ample, consider C++.
Although it was possible to compile a C++ program for just about any type of CPU, to
do so required a full C++ compiler targeted for that CPU. The problem, however, is that
compilers are expensive and time-consuming to create. In an attempt to find a better solu-
tion, Gosling and others worked on a portable, cross-platform language that could produce
code that would run on a variety of CPUs under differing environments. This effort ulti-
mately led to the creation of Java.
About the time that the details of Java were being worked out, a second, and ultimately
more important, factor emerged that would play a crucial role in the future of Java. This
second force was, of course, the World Wide Web. Had the Web not taken shape at about
the same time that Java was being implemented, Java might have remained a useful but
obscure language for programming consumer electronics. However, with the emergence
of the Web, Java was propelled to the forefront of computer language design, because the
Web, too, demanded portable programs.
Most programmers learn early in their careers that portable programs are as elusive as
they are desirable. While the quest for a way to create efficient, portable (platform-inde-
pendent) programs is nearly as old as the discipline of programming itself, it had taken a
back seat to other, more pressing problems. However, with the advent of the Internet and
the Web, the old problem of portability returned with a vengeance. After all, the Internet
consists of a diverse, distributed universe populated with many types of computers, operat-
ing systems, and CPUs.
What was once an irritating but a low-priority problem had become a high-profile ne-
cessity. By 1993, it became obvious to members of the Java design team that the problems
of portability frequently encountered when creating code for embedded controllers are also
found when attempting to create code for the Internet. This realization caused the focus of
Java to switch from consumer electronics to Internet programming. So, while it was the
desire for an architecture-neutral programming language that provided the initial spark, it
was the Internet that ultimately led to Java's large-scale success.
How Java Relates to C and C++
Java is directly related to both C and C++. Java inherits its syntax from C. Its object model
is adapted from C++. Java's relationship with C and C++ is important for several reas-
Search WWH ::




Custom Search