From: Josh Russo on
I know the general thoughts surrounding most web frameworks, being
largely unnecessary and at times producing problems of their own. With
that in mind, what are people's thoughts on GWT? In case you don't
know it auto-generates all of the JS and HTML. You do everything in
Java.

One of the big benefits to this is that you can more easily unit test
your interfaces. Of course you are trusting Google to produce good JS,
but this really isn't a new paradigm. Other languages/frameworks have
done the same for C and C++. You generally lose flexibility but it's
usually the more arcane functionality that is lost.

Personally, I'm just starting to research GWT but it seems really
intriguing.

What are your thoughts?
From: Garrett Smith on
On 2010-08-05 04:12 PM, Josh Russo wrote:
> I know the general thoughts surrounding most web frameworks, being
> largely unnecessary and at times producing problems of their own. With
> that in mind, what are people's thoughts on GWT? In case you don't
> know it auto-generates all of the JS and HTML. You do everything in
> Java.
>
> One of the big benefits to this is that you can more easily unit test
> your interfaces. Of course you are trusting Google to produce good JS,
> but this really isn't a new paradigm. Other languages/frameworks have
> done the same for C and C++. You generally lose flexibility but it's
> usually the more arcane functionality that is lost.
>

I always give my stock recommendation to carefully review the source
code of any third party code, and offer the code guidelines document to
help with that:
<http://jibbering.com/faq/notes/code-guidelines/>

Regarding what little I know of GWT:
* The overall design is based on using browser detection to send
browser-specific JS (or try to).
* You're stuck writing it in Java, unless you use the "JSNI" or
"native", which still requires editing and compiling java

I can't say anything about the quality of the JS code because I have not
reviewed it recently but the overall strategy of browser detection is an
architectural mistake.


I have noticed that a lot of Google apps use global identifiers (DOM tab
in Firebug).

> Personally, I'm just starting to research GWT but it seems really
> intriguing.
>

I thought so when I first heard of it. I quickly changed my mind after
looking into it.

> What are your thoughts?

The problems with browser detection have been discussed to death.
There's even an article on it in the notes:
<http://jibbering.com/faq/notes/detect-browser/>

The idea of sending browser-specific code, streamlined for each browser
sounds good but it doesn't provide clean abstractions of the problem of
dynamic environment. Instead, it couples the code to tool and uses an
unrelated inference (User Agent). That strategy will fail in cases, to
identify the browser and can result in cases where the user has a
perfectly good browser that could have worked, but didn't pass the
browser whitelist check.

I noticed that the author of GWT actually advocated the practice of
global variables and actually went on to provide a reason that it helped
performance.
<http://blog.j15r.com/2009/08/where-should-i-define-javascript.html>

But actually global identifiers don't help performance -- they hurt it:
<http://groups.google.bg/group/comp.lang.javascript/browse_thread/thread/566395fc193eb4f1/>

Now don't know if the practice of using global variables made it into
GWT or not, but I do see a lot of globals in Google js and the author
advocating something like that is something to be concerned about.

The browser detection-based architecture is the most obvious deterrent.
--
Garrett