Re: Why is java considered a language for "web" or "internet" programming?
BillJosephson wrote:
Howdy....
I've been learning a bit of java, because I've been led to believe it
is the language to use if you want to make web sites. So far, it just
seems like C or C++, more or less.
What is it about java that makes it good for people making web sites?
Two immediate reasons: portability and safety.
"Write once, run anywhere" somewhat overstates the reality
of Java's portability, but a wide variety of machines can execute
Java bytecodes with reasonably consistent results. When you put
a Java program on your Web site, you don't need to worry (much)
about whether your visitors use Windows, Linux, MacOS, AIX, ...
No matter what they use, your program (mostly) "just runs."
As for safety -- Hey, Bill, you don't know me, but my Web
site sure looks cool, and how's about I just run this chunk of
code on your machine? It, um, it improves your interaction,
yeah, that's it, your interactive experience. Trust me. Because
the JVM on your machine can analyze the incoming bytecode before
executing it, it can prevent that code from doing "dangerous"
things without detection. Sure, flaws have been found in Java's
security, but it remains far safer than downloading and executing
native machine code from an untrusted site.
Those, at least, are the principal advertised benefits. They
are realized incompletely (nothing is perfect), and there are some
drawbacks to offset them (nothing is perfect), but that's the idea.
--
Eric Sosman
esosman@acm-dot-org.invalid