Client Side Java - Don't use it


Java is supposed to be a standardized language that can be used to develop complex applications. I have seen several examples which prove this to be true.

However, my experience writing the equivalent of a 2 line version of "Hello World" is that all the effort spent on Java development is totally wasted.

The advertising slogan is

Write Once and Run Everywhere

Many web designers say

Write Once and Debug Everywhere

However, my experience is

Write Once and Throw It Away

(I am told that WordPefect spent millions developing a Java version. Since it is not on the market, I assume that they had the same experience.)


Example 1

I used IBM's VisualAge Java development system to write a simple program which uses the standard awt label object to place text on the screen. It compiled and ran perfectly in the provided JVM (Java Virtual Machine, aka Java Interpreter). Java code and example (Displays nothing in Netscape 3.02 Gold and 2 of 3 labels in IE 4.72). (I tried to import this back into Visual Age in order to simplify it ... but it would not show the existing display objects. Apparently, if code is modified by hand, you're screwed!)

Thus proving that adage - Write Once and Throw It Away

IBM's VisualAge placed the following code in the application

   setLayout(null); 
I have tried 3 reference books, and none of them even mentions what a null layout might do. Perhaps VisualAge should be strongly advoided for using un-documented features.

Well, documented or not, the null layout is probably the best layout because it gives the programmer the most control over how the application will be displayed. (Of course, one of the touted benifits of Java is that the developer can only suggest how the application will be displayed. Give me a break.) For more details, see here.


Debug Problems

This one took most of a day to figure out.

When I write html code (using notepad, of course :), I do a save (Alt f s), Alt-Tab to the browser, and refresh (F5 in IE) to view the changes. Therefore, I expected Java to work the same way.

Suprise ... refresh does not load the new class file. Instead, you have to kill all instances of your browser and restart it in order to read the new code. What a load of ... . I spent hours trying to find a way around this stupidity.

This nonsense was tested with both IE 4.0 and Netscape Communicator. I hearby confirm that both products are brain dead!

Actually, Ctrl-F5 is supposed to re-load class files in IE 4.0 (I have verified this with IE 4.72).
Ctrl Shift R is supposed to cause Netscape to re-load everything (I haven't verified this yet).


Notes


References


Author: Robert Clemenzi - clemenzi@cpcug.org
URL: http:// cpcug.org / user / clemenzi / technical / HTML_Examples / Java.htm