Java Reference
In-Depth Information
type-safe languages such as Java and C# have supplanted C and C++ in various applications
when the additional run-time footprint is acceptable.
Prior occupancy of a niche tends to discourage competitors. Changing to a new language and
tool chain is often too painful for just a single feature, but newcomers will eventually displace
existing languages, unless they evolve fast enough to keep up (older readers are often able to
quote a range of such languages in which they've previously coded but whose popularity has
since waned—Ada, Algol, COBOL, Pascal, Delphi, and SNOBOL, to name but a few).
You're a Java programmer, and Java has been successful at colonizing (and displacing
competitor languages in) a large ecosystem niche of programming tasks for the last 15 years.
Let's examine some reasons for that.
1.1.1. Java's place in the programming language ecosystem
Java started well. Right from the start, it was a well-designed object-oriented language with
many useful libraries. It also supported small-scale concurrency from day one, with its
integrated support for threads and locks (and with its early prescient acknowledgement, in the
form of a hardware-neutral memory model, that concurrent threads on multicore processors can
have unexpected behaviors in addition to those that happen on single-core processors). Also, the
decision to compile Java to JVM bytecode (a virtual machine code that soon every browser
supported) meant that it became the language of choice for internet applet programs (do you
remember applets?). Indeed, there's a danger that the Java virtual machine (JVM) and its
bytecode will be seen as more important than the Java language itself and that, for certain
applications, Java might be replaced by one of its competing languages such as Scala or Groovy,
which also run on the JVM. Various recent updates to the JVM (for example, the new
invokedynamic bytecode in JDK7) aim to help such competitor languages run smoothly on the
JVM—and to interoperate with Java. Java has also been successful at colonizing various aspects
of embedded computing (everything from smartcards, toasters, and settop boxes to car braking
systems).
How did Java get into a general programming niche?
Object orientation became fashionable in the 1990s for two reasons: its encapsulation discipline
resulted in fewer software engineering issues than those of C; and as a mental model it easily
captured the WIMP programming model of Windows 95 and up. This can be summarized as
follows: everything is an object; and a mouse click sends an event message to a handler (invokes
the Clicked method in a Mouse object). The write-once run-anywhere model of Java and the
Search WWH ::




Custom Search