Hacker News new | ask | show | jobs
by richcollins 6026 days ago
How could trading the expressiveness of JS for the expressiveness of Java without the commensurate increase in performance be "So good it's ridiculous".
3 comments

You clearly didn't RTFA.

I'll give you my personal reasons for liking GWT in a few short bullets.

1. Better tooling - IDE refactoring when I need to change things. Red squigglies when I make a typo or reference something thats not there. A real debugger with breakpoints for finding bugs. Auto completion and auto style formatting so I dont have to type so goddamn much.

2. Compiler optimizations - Your code gets faster and smaller. Write maintainable code, have it turned into performant code.

3. API's and libraries - easy client server RPC, discoverable wrappers for the DOM APIs. Reuseable widgets that have predictable structure/side effects!

4. Maintainable code base - If you worked with more than 4 engineers on a non-trivial product, you would understand the appeal of a Java code base. UIBinder lets me not worry about CSS name collisions.

I would go on, but you seem like a TLDR type of person, so it would probably be a waste of my time.

Was the personal attack at the end necessary?
Probably not. I sometimes get annoyed when people, faced with the choice of gaining some domain knowledge before forming an opinion, decide to instead just be loud about things they know little about.

Personal attacks are lame though, even on the internet. Thanks for calling me out on it :).

I apologize.

Agreed.
1. No reason you couldn't do this in JS (see Smalltalk)

2. The new JS VMs do plenty of optimization

3. C has more libraries than Java. Lets use C for everything

4. Actually, there is a lot of evidence that maintainability is inversely related to the number of lines of code. The more lines, the more bugs. (I don't have time to find the studies. They are there if you Google them.)

I did read the article. I just wasn't interested in writing a treatise on the subject. Just wanted to give a counter point.

Good response to the question, which was clearly loaded
Why ask this forum when the article explores this in detail?
Does it, really? Most of the optimizations mentioned in the article (compression/obfuscation, module system, yslow integration) or in these comments (debugging, refactoring, auto completion) are all available/possible in javascript alone. What tangible benefits require Java's type system?
Guided code splitting and type tightening (with associated devirtualization) are serious optimizations that can't be done today in JS. GWT can guarantee the immutability of JS object shapes - something you can't do with bog-standard JS.
The performance that GWT is able to get is impressive. There are all kinds of optimizations they can make because of the assumptions they have, especially that you will run the code through the compiler.