Hacker News new | ask | show | jobs
by jsjenkins168 6588 days ago
Because browsers suck and native javascript behavior is not predictable across platforms.

In GWT the browser is abstracted and you dont worry about it. You write AJAX code and it always works. Firefox, IE, iPhone, whatever.

Writing the code itself is not where the real time investment is with ambitious ajax projects. Its wasted in browser-related quirks and debugging. Being able save this valuable time and focus on building something cool is worth it in my opinion.

Also GWT is just plain faster.

3 comments

"Writing the code itself is not where the real time investment is with ambitious ajax projects. Its wasted in browser-related quirks and debugging."

That has not been my experience. I've found that the vast majority of my JavaScript development time goes to areas that are hassles in any rich UI programming (I was a Swing and then Netbeans developer before I turned to the web):

1.) Forgetting to call a listener or otherwise update UI state.

2.) Finding that the UI really works better if some faraway component auto-updates its state when you change this menu item, and having to plumb the update through the whole app.

3.) Working out corner cases when the user selects some combination of options that's so crazy you didn't think anyone could possibly choose it.

I usually do all my development in Firefox and then set aside a week or so to port to IE, which I know everybody says is a terrible development practice, but it's worked on multiple projects for me. I just memorize all the areas where I'm likely to have problems, and avoid them. I usually find that well ofter 60% of the bugs are trailing commas anyway - the event-handling and DOM differences are taken care of by JQuery, and there really are not that many other core language differences.

JavaScript is mostly the same across platforms, the difference is in the DOM and CSS support. This can be encapsulated in libraries like JQuery.

GWT solves a different (perceived) problem - the lack of classes, inheritance, packages and static type checking in the core language - which is orthogonal to the platform differences.

Yes, but abstracted away to Java?

Ok, I see you have a point and that does seem like a good idea. The choice of language just seems crazy.