Wes Groleau wrote:
>I was responding to the much-exaggerated claim of Java's portability.
>Sure, it's nice to have the same "object code" run on multiple platforms.
>But the Java folks are trying to make us think that the Java _language_ is
>somehow more portable than any other. It is not.
Well, in fact it is. Very little in the Java language is left
implementation dependent. Order of expression evaluation? Left to right.
Size of primitive data? Completely specified (e.g. 32 bit 2's complement
for int, etc.) Parameter passing? By copy. Semantics of floating-point
arithmetic? IEEE-754. References to uninitialized values? This can't
occur. Character set? Unicode.
There are a few implementation dependences. Perhaps the most glaring is how
priorities affect thread scheduling (although, in fairness, the Ada core
language does not address this point). Also, since the language rules don't
say when garbage collection occurs, the effect of the finalize() method is
not too well defined. But on the whole, the language semantics are
specified at a much tighter level of detail than most languages, including
Ada. (A downside is a potential efficiency hit, but that's another topic.)
The API is a different situation; e.g. there have been horror stories about
the non-portability of the AWT. And obviously the effects of environment
inquiry methods depend on the platform. But as far as the Java language
semantics are concerned, the designers sought to completely eliminate
implementation-defined/dependent behavior, and they have come pretty close
to meeting that goal.
[log in to unmask]