3 ms·
I suppose you could use GWT to compile Java to JavaScript. To me GWT is still the weirdest open source project ever: why would you go to these lengths to be abl
by Tichy 15y ago
I suppose you could use GWT to compile Java to JavaScript. To me GWT is still the weirdest open source project ever: why would you go to these lengths to be able to write in an ugly language (Java) that compiles to a pretty language (JavaScript). But to each their own - I know people who use GWT in production.
- wladimir 15y agoA big reason to use GWT, from what I've heard, is code sharing between client and server code (for example, data validation). Of course, nowadays you can do the same by using javascript both server and client side...
- richardw 15y agoI use both Javascript/JQuery and GWT, depending on the task. I'd use GWT when I want more predictability - when an app is complex enough that I'd like to be able to move bugs to compile time instead of run time (unit test or otherwise). With GWT you don't look for a bug in Chrome's Javascript console, say. A new browser comes out with weird specifics? Great. Switch on the flag for that browser and recompile, and that browser gets a unique snowflake version that works perfectly. Over time, GWT will improve the JS it compiles to, even given the same source code. It gets faster independent of the browser improvements.
- Stratoscope 15y agoI tend to agree with you - I greatly prefer JavaScript to Java myself. But I did hear one argument for GWT that I found persuasive - that they are able to do optimizations in the generated JavaScript code that we probably wouldn't - or couldn't - do in more idiomatic JavaScript. I didn't find this persuasive enough to use GWT myself, mind you. :-) But it does seem like a valid reason someone might want to use it.