
What is wrong with GWT. - uriel
http://ryandoherty.net/2007/04/29/why-google-web-toolkit-rots-your-brain/
======
alexkearns
This is just another example of the "there is only one way to do things, my
way" philosophy that taints so many discussions about software development.

Sure, GWT does not create the cleanest mark-up and javascript in the world but
maybe that is not always your goal. You may just want to get a web app up and
running quickly but are lacking the javascript expertise - cue GWT, which
allows you to harness your java expertise to create a web app.

If you don't like to create web apps this way (I for one would much prefer to
hand code javascript), then don't but also don't go around name-calling the
technology "disgraceful" just because it does not serve your own specific
purposes.

~~~
MostAwesomeDude
Why does one need JavaScript to build a web application?

------
ses
This is an old article, and a poorly written one at that.

Strikingly though one of the criticisms that seemed most poignant to me is:

"GWT completely ignores the fact you are creating a website, NOT an
application"... I think this shows a serious lack of forethought on the
author's part to not see that many websites were turning into web
applications, and many enterprise applications with desktop clients had also
started to go down this route.

~~~
darklajid
You should have read the link at the top as well, providing a follow-up that
mostly contains "Ok, I didn't know thaat much about GWT when I wrote the first
post, so here's my largely revised and far less polarizing opinion".

~~~
drivebyacct2
And this is why my blog only has 4 posts over 2.5 years. I simply don't have
the desire to take on such polar opinions with such little topic background.
It seems these knee-jerkish opinion bits on Dart, GWT, X, Y, Z have grown in
popularity here. I enjoy the discussion because the comments here are full of
more information than I could quickly aggregate myself, but I wonder when I
will become a pompous enough software engineer to feel the need to write posts
like this.

------
VikingCoder
What is wrong with blog posts

Lately I've been reading a lot of blog posts assailing a technology as though
proponents of that technology think all other tools are useless in all
situations.

Replace "GWT" and "JS" in this article with "C++" and "Assembly," and all of
the points still hold. But C++ is still incredibly useful for many developers,
and so is GWT.

GWT largely exists because it has a reason to exist. One of its main reasons
to exist is that browsers are not standards compliant, and sometimes the
standards are ill-defined. A well-defined abstraction layer on top of that is
very useful... right up until it's not. Sometimes you need to dig in to
Assembly, and sometimes you need to dig in to JS. But quite often, higher-
level abstractions get you all the way from start to finish.

~~~
vetinari
Actually, my first thought when reading this blog post was "oh no, it's C vs.
hand-tunes assembly again." We know, how that ended up.

~~~
rbanffy
You know... It's in fact much more like the reverse: compiling assembly
language into C. Java is a less expressive language than JavaScript. The
result is that you code in the slow-to-develop/fast-to-run language and it
spits out fast-to-develop/slow-to-run code.

------
PaulHoule
"Any time you program one language in another, you lose all the benefits of
the target language"

... yeah, like when C gets compiled to machine code, you lose all the benefits
of machine code.

On some level that's true. You can certainly write machine code that's faster
than C, and often you can take advantage of hardware features that the C
compiler can't use (in some cases, SIMD.) On the other hand, C code can be
portable across platforms and developers can be more productive.

GWT keeps one important attribute of Javascript: the ability to run cross-
platform on web-browsers. It trades the benefits of programming in Javascript
for the benefits of programming in Java. Static types have some advantages,
and you get to work with Eclipse and have automated refactoring and a good
debugger.

His fundamental criticism against single-page webapps is valid, but this is
true about Java applets, Flash, Silverlight as well as some Javascript
frameworks.

A fundamental criticism I'd have of GWT is that it's very to build very
complex applications in GWT, complex enough that the problem of managing
asynchronous communication becomes a real bear.

~~~
rbanffy
> ... yeah, like when C gets compiled to machine code, you lose all the
> benefits of machine code

You know that's an apples to oranges comparison. JavaScript and C are much
more expressive than assembly language. This complain is that you are writing
code in a less expressive language (Java) that's being compiled into a subset
of a more expressive one (JavaScript).

~~~
PaulHoule
Assembly, C, Javascript and Java are equally "expressive" in the sense that
they're Turing complete. Anything that can be "expressed" in Javascript can be
"expressed" in Assembly.

Most of the features people like in Javascript can be faked in some manner in
Java. Anonymous objects can be used to insert anonymous functions into Java
code... At great cost in verbosity. Variables never really escape Java
"closures" but the resulting immutability leads to a functional programming
style that has real benefits.

Javascript's real advantage is a clearer syntax that's easier to learn and
easier to read. If statically typed languages value concision, we can get the
benefits of static types with little cost.

~~~
rbanffy
Expressiveness of a language is not the scope of what it can express, but how
much you must write in order to express something.

------
rdoherty
Oh hi, OP here. I wrote this a _long_ time ago. My opinion has changed a
little in that time. I've already heard the arguments for/against GWT and
understand its benefits. Not really sure why it's on HN now and honestly a
little embarrassed by it.

------
ttcbj
In my view, GWT is for creating large/robust web-based applications, and that
is where machine-level optimizations really pay off. If you are writing a tiny
utility on a page, hand coded javascript might pay off, but if you are writing
a large/complex application, it becomes impractical for a human to do what a
optimizer can.

I am not saying that GWT is perfect for everything, but it pains me to think
of writing (and debugging, and refactoring) a large application in javascript,
or any weakly typed language. I've tried it, and found it difficult to
maintain.

~~~
rbanffy
Is there a good definition of "robust" in this context?

------
rbanffy
Independently of the merits of GWT or the follow-up apology post, Java is an
awful language to write web applications with. Languages like Ruby and Python
(mostly when associated with frameworks like Rails or Django) allow you to
become much more productive, yield a much smaller codebase and much lower
long-term maintenance costs.

As for the JavaScript side, if you find it daunting, you may try Coffeescript
or even Closure (which provides some Java-developer-friendly limits to
JavaScript).

Java has its strengths, but writing web applications isn't among them.

~~~
PaulHoule
I've got complex feelings about Java.

The comparison with Ruby and Python isn't really fair. A better comparison is
C#, which is like Java in spirit but has a large number of incremental
improvements over Java.

Underlying it all, Java has an attitude that concision doesn't matter. One
reason why people don't do anything interesting with generics because you
always have to write

GenericContainer<AnotherGenericContainer<ArbitaryTypeA>,AbitraryTypeB> = new
GenericContainer<AnotherGenericContainer<ArbitaryTypeA>,AbitraryTypeB>();

C# has var, extension methods, function pointers, generics without type
erasure and many other little things that show respect for the programmer. You
realize then that the "problem with Java" isn't an all or nothing thing
(static types suck), but an obstinate cultural attitude that's gone on for 15
years.

C# might not be as concise as some languages, but it shows you can have
something a lot like Java that isn't as bad... and that makes it clear how
outrageous Java is!

~~~
rbanffy
> The comparison with Ruby and Python isn't really fair.

It's fair because there is nothing stopping you from picking up any of them, a
decent framework and be orders of magnitude more productive than either a Java
or a C# developer. C# is a better language than Java, but it still comes short
when it comes to developing web applications.

There are hugely successful apps written in C# and Java, I agree, but their
existence is owed more to the brilliance of their developers than a brilliant
choice of tools.

~~~
PaulHoule
"Orders of magnitude more productive" isn't true -- except in the case that
the productivity of people on a failed project is zero.

For projects that get completed, I could believe two or three... Maybe more in
cases that are trivial to do with rails.

The nightmare I've seen happen with Ruby projects is that the "developers" are
often web designers who know how to do things that are easy (or trivial) to do
with rails, but get in over their heads rapidly.

Python, on the other hand, has a culture of doing the 20% of the work that
gets you 80% of the way to production, announcing that they're done, moving on
to a greenfield project, and then laughing at the "Blub" programmers in PHP
and Java who work so much harder to get things production-ready.

Java's greatest strength, on the other hand, is it's greatest weakness. Java
has a huge number of libraries that make it possible to do wonderful things,
like Lucene and Hadoop. There's "more than one way to do it", which means that
real-life systems might have 5 different JSON libraries used in different
parts of the system. A programmer who needs to work on a small part of an
application might need to wait for Maven to download 650 megabytes worth of
JAR files. When you have 650 megabytes of dependencies to deal with to work on
65 kilobytes of code, it takes a very small amount of bullshit per kilobyte in
the dependencies for you to spend more hours messing around with the build
system than you spend developing.

~~~
rbanffy
I have to disagree with your two misconceptions:

> Ruby (...) "developers" are often web designers who know how to do things
> that are easy (or trivial) to do with rails

> Python (...) has a culture of doing the 20% of the work that gets you 80% of
> the way to production, announcing that they're done, moving on to a
> greenfield project

I have met, during my career, a lot of incompetent professionals like the ones
you describe above. Most of the time, they work with "safe" technologies, the
ones they are sure there will be demand for. Java, PHP, C#, ABAP and VB are
their favorite tools. When you see someone proposing something crazy, like
using Python (or Ruby, or Smalltalk, or Lisp, or Erlang) on a very enterprisey
application, they are either lunatics or just very, very smart. BTW, to be
fair, I've seen lots of very competent Java, PHP, C# and even VB programmers.
But they are exceptions, not the norm.

And no. I have developed tons of Python code from concept to production. If we
have this 80/20 culture, I have, so far, managed to be completely oblivious to
it. The main difference between your anecdote and Java projects I have seen in
the past is that nobody but management claims they are done.

------
joshhart
Check out scalagwt. They've enhanced GWT to read a protobuf abstract syntax
tree so that any language could be compiled to javascript if it can target
that output. The first language they have working is Scala, which is far more
suited to working with frontend code than java and in my opinion better than
javascript. The nice thing about GWT in general is that you get to use a
traditional oop approach to maying out the components of a webpage ala java
swing.

[http://www.google.com/m/url?client=ms-android-
verizon&de...](http://www.google.com/m/url?client=ms-android-
verizon&devlocsession=off&ei=_VSUTuDEMoXaqAPNhwE&gl=us&hl=en&q=http://scalagwt.github.com/&source=android-
browser-type&ved=0CBcQFjAA&usg=AFQjCNE5sNJ8eaGDqMVqJniEiKBlgzKOHA)

------
tcarnell
EVERYTHING is wrong with GWT - just dont use it.

Generally I believe the idea of writing code in one language to be converted
into another is wrong. Languages are tools to do a job - pick the right one
for the job or it will end in tears.

~~~
alexkearns
Unless you write your software in binary, every piece of code you write will
be converted into another language.

~~~
rbanffy
I believe his point is that you should write in the most human friendly
language you can and, maybe, let the computer translate what you wrote into
something less human-friendly that the computer can run fast.

------
jfoutz
Our customers were thrilled to see their 20 year old applications running on
an iPad. I don't know how that would be possible without a java interpreter
for funky old languages, and GWT as a bridge to the web.

------
jtmille3
Just to beat a dead horse, most languages, especially scripting languages
compile down to something else. I don't use GWT, but I could understand the
lure of using a known language that has established great tools to create a
powerful web applications. From what I understand it will even optimize then
obfuscate the javascript for you. As for the degradation argument, that is a
weak negative.

