Sunday, February 10, 2008

Echo2 and GWT

I've had a fairly good experience with Echo2 so far and relatively less so with GWT - but I thought I'd just record my biggest gripe with GWT so far.

As I noted in my previous blog - Google effectively creates their own JVM in the browser. This results in non-trivial differences for a developer:
  • You have to remember that the code you write has to be compliant with the 1.4 Java spec. This means that although you may write perfectly compiling code using your Eclipse IDE (set to 1.4+ compiler compatibility - after all we're all on Java5 now if not Java6) the GWT compiler will throw errors if you use any of the Java5+ language features
  • Even within Java 1.4 limits, fairly innocuous things like System.arraycopy() are not supported.
  • You lose the ability to use something as useful as Java's built-in logging feature - Eclipse based debugging is all very fine, but we all know that debugging is only useful for the last mile. Logging is the the meat and potatoes of most trouble shooting for most developers and GWT does not give us a good way to do that yet.
These are problems as of now. Google keeps getting better, so I hope to see a lot of this gone pretty soon. But, splitting the spec by calling the libraries Java compatible while having so many issues, reminds me too much of Microsoft's bastardization of Java a few years back. This is a new VM which breaks the Java promise of write once and run anywhere in many ways and that should be made clear right at the outset...

Incidentally none of these are issues for Echo2. Since all the code you develop (aside of course from any custom scripting) is run on the server side - you can use all Java features without any issues.

No comments: