This week's book giveaway is in the Artificial Intelligence and Machine Learning forum.
We're giving away four copies of Machine Learning with R: Expert techniques for predictive modeling and have Brett Lantz on-line!
See this thread for details.
Win a copy of Machine Learning with R: Expert techniques for predictive modeling this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Is it worth learning GWT in 2015 if you already know JavaScript?

 
Ranch Hand
Posts: 157
Netbeans IDE Postgres Database Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello:

I started my programming career with technologies aimed to the client side (HTML, CSS, JavaScript, ActionScript). But some years later I also worked with server technologies: first with PHP and then with Java EE. I liked Java so much, that I aimed my career to it almost exclusively. This made me miss out lots of important JavaScript projects, such as jQuery, DOJO, AngularJS, Ember.js, etc. Well, I tried one or two of them slightly, but all this time I've been using my own (and very old) libraries. Now I believe that it's time to abandon my crappy libraries and catch up with the new Web technologies.

Although I know that "I've arrived late to the party", I've considered the JS projects that I've mentioned above, plus others that are more recent, such as Polymer.js and Aurelia. But although I loved dynamically typed languages at the beginning of my career, now I must admit that it's the opposite. I prefer statically typed languages not only because it's easier to detect errors while programming, but because the IDEs can do much more with them. This has made me re-consider technologies such as TypeScript and Dart. Specially because I'm seeing that many programmers are starting to use JS as a type of "bytecode for the Web", while they code in a stricter language. But then I've wondered why to learn a new language if I can use something like GWT, which is written in Java.

I know that GWT is not "the trend of the moment" any more because of the boom of the JS frameworks. And also that its development has slowed down for the last years. However, the fact that a similar concept to GWT's is being used in new pseudo-JS frameworks, and the fact that the project could be revived in 2015 2016, have led me to want to learn GTW. But I still have doubts... These are:

* Do you think that is it worth learning GWT at this point?
* Do you think that is it worth learning GWT although I know JS/DOM, as way to avoid the dynamic typing?
* Given the need, Could I manipulate the DOM from Java as I do with JS? (I think I could use GwtQuery)
* Do you think that GWT still has a healthy future? The official blog seems to be inactive since 2014 :/ .

Thank you.
 
Marshal
Posts: 67289
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
  • No
  • No
  • Don't know - irrelevant in context of my other answers
  • No
  •  
    Avor Nadal
    Ranch Hand
    Posts: 157
    Netbeans IDE Postgres Database Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hello Bear Bibeault:

    First of all, thank you for your response. Wow, I didn't believe that the future of GWT was so dark :S . I knew that it was complicated, but not so much. Taking into account that new languages such as TypeScript work by compiling their selves to JavaScript, I thought that GWT could have a revamp. I know that TypeScript integrates with JavaScript much better than GWT, because it's a superset of it really. But with some changes, I hoped that GWT could do something to alleviate the integration of JS into it. I also read a little about Errai, based on GWT, and seemed really interesting. Specially because it allows to use HTML templates and CSS, which I like much more than those templates in XML that I've seen in some GWT guides.

    What would you recommend then? I've been working with JS for many years, but once I got used to the static typing in Java, it frustrates me a lot when I've to refactor something or check the types that a method receives or returns. Do you think that TypeScript should be the path to follow?

    Thank you.

    PS: Oh. I forgot to comment about WebAssembly. Doesn't it give some hope to projects like GWT? It seems that in the future we will be able to use our favourite language and compile it to WebAssembly.
     
    Bartender
    Posts: 11445
    18
    Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Simple test:
    1) Go to your favorite job site
    2) Search for {technology which interests you} jobs
    3) Check out number of openings, related technology requirement etc
    4) Repeat #2 & #3 for competitive technologies
    5) Evaluate
     
    Bartender
    Posts: 2407
    36
    Scala Python Oracle Postgres Database Linux
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I'm not a web specialist, but I looked at GWT when it came out and TBH I couldn't see a reason to use it - it was at least as complex as writing all those JS callbacks yourself, it felt unmaintainable, it was a pain having to regenerate the JS to fix a tiny bug, and it was hard to figure out what the final JS was really going to do. So I'm not really surprised it seems to be withering on the vine, as JavaScript has got a lot better over the years, and maybe Java developers have finally abandoned the "Java for everything" mantra. The strange thing is that there are other similar frameworks emerging for other languages e.g. ClojureScript or Scala.js that take your source code in another language and turn it into JavaScript. Some people seem to find this very useful e.g. ClojureScript seems to have a fairly keen following among the relatively small number of people who use Clojure. But I would think that to make best use of these X-to-JavaScript frameworks, you probably need to understand what JavaScript can do, and what the generated code actually does. If you know all that, then why not just write the JavaScript yourself and remove an extra source of complexity in your stack? I'm clearly missing something here.

    Alternatively, you can go the other way and use JavaScript everywhere e.g. the MEAN stack.

    As I say, it's not my specialism, but if I were working in this area I'd probably want to focus on getting really good at JavaScript, plus whichever other tools/languages seem interesting/marketable, then trust that I could probably pick up ClojureScript or Scala.js etc if I really needed it for a specific project. YMMV of course.
     
    Avor Nadal
    Ranch Hand
    Posts: 157
    Netbeans IDE Postgres Database Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    Maneesh Godbole wrote:Simple test:
    1) Go to your favorite job site
    2) Search for {technology which interests you} jobs
    3) Check out number of openings, related technology requirement etc
    4) Repeat #2 & #3 for competitive technologies
    5) Evaluate



    Thank you. I hadn't thought of that. I have seen that GWT has lost much traction :/ .

    chris webster wrote:...


    Thank you for sharing your experience. That's what I needed to know. My feelings towards GWT are being exactly like that. I've felt that the abstraction that GWT tries to do is leaky and requires that you understand many concepts of JavaScript and CSS, plus many new concepts that are specific of the tool kit. For someone like me, who already knows the technologies of the Web, it's not so complicated. But even so, having to take care of an extra layer of abstraction outweighs the benefit of using static types, which was the main feature that I was looking for.

    With GWT 3.0 it seems that this is going to change. They want to convert it in a transpiler with custom wrappers around JavaScript, so you can re-use all the existing JS libraries and frameworks, but with static typing, ala TypeScript. I'm happy with that decision. That's what I need. When they complete that transformation, I'll reconsider GWT. But right now I'm going to have to continue programming in pure JavaScript.
     
    Bartender
    Posts: 1175
    38
    IBM DB2 Netbeans IDE Spring Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi Avor,

    at work we're evaluating GWT as a framework / sdk to build complex web apps, without having to deal with js, css, html stuff. We are more expert in Java than in web-client programming, so that a framework who lets you to write both server and client parts in a single, well-known, strongly typed, and effectively debuggable language is real appealing. For the very same reason, we're evaluating JSF too.

    My main concerns with GWT are the following:

    - Google has open sourced it, and, although this doesn't mean that Google has dumped GWT (despite of what sometimes I read on the web), at least means that Google loosed part of its interest in it.
    - GWT has not been updated for a while. Last version backs to 2014, and GWT 3.0 release date is always deferred. This a bad sign in my opinion.

    So, for a new project i'm afraid of entering a dead end with GWT.
     
    Greenhorn
    Posts: 2
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    You may want to look into jsweet: http://www.jsweet.org/

    It seems to be what GWT 3.0 has been promising, but without all the GWT baggage.

    I've recently abandoned GWT for writing my webapps in TypeScript, ...until I found jsweet.

    It's basically a transpiler that turns your Java code into TypeScript, and then into JavaScript. The goal isn't to recreate the JVM in JavaScript like GWT. Instead, it provides a way to write TypeScript/JavaScript using the Java language syntax, and leverage all the type definitions that have been created for JavaScript libraries (they have a way of converting *.d.ts files into java classes).

    Anyway, I'm a long time Java developer, and I've been using jsweet for two days now. So far, I've found it very easy to take the whatever I was doing with TypeScript, and do the exact same thing using Java, with all the Eclipse tooling I'm comfortable with.
     
    Claude Moore
    Bartender
    Posts: 1175
    38
    IBM DB2 Netbeans IDE Spring Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    J Albright wrote:You may want to look into jsweet: http://www.jsweet.org/


    It looks iteresting, what about gui components ?
    And, more important, how strong is community behind JSweet ? I'm asking that because my biggest concern about GWT is that it doesn't seem to evolve and grow at the pace typical of a successful and popular frawework.
    AnywayI'm still waiting to see what enhancements GWT 3.0 will bring.

    And welcome to the ranch !
     
    J Albright
    Greenhorn
    Posts: 2
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I'm not aware of any JSweet UI components, and I'm not sure if that would ever be on their roadmap. I believe the purpose of JSweet is to simply write JavaScript using the Java language syntax, similar to how TypeScript does. So your choice of UI framework would be whatever JavaScript UI library you'd like to use.

    I had the same question about the strength of the community, since it seems the 1.0 release came out so recently. Hopefully it will grow at the pace you mentioned for a successful and popular framework, but it seems it just needs to stay in lock-step with TypeScript, since it uses the TypeScript transpiler underneath.

    I'm hoping GWT 3.0 will give us some good enhancements as well. But honestly, if they were to give me exactly what I wanted, it would essentially be JSweet (for example, in Eclipse every time I save MyClass.java, it immediately creates MyClass.js, and I can just reload the web page to see the changes).
     
    Greenhorn
    Posts: 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    J Albright wrote:I'm not aware of any JSweet UI components, and I'm not sure if that would ever be on their roadmap. I believe the purpose of JSweet is to simply write JavaScript using the Java language syntax, similar to how TypeScript does. So your choice of UI framework would be whatever JavaScript UI library you'd like to use.



    You are perfectly right. I contributed to JSweet and it is totally the initial spirit to keep it lightweight, as close as possible to Javascript (including libraries & ecosystem) while bringing the strength & professionalism of the Java syntax / compilation / tooling.

    If you want nice builtin UI components using modern web technologies, I suggest you use Ionic 2 or Polymer. I just published an example of a Polymer app in JSweet:
    https://github.com/lgrignon/jsweet-cordova-polymer-example

    And if you want to stick with long time proven technologies, you could stay on Ionic version 1, which is pretty honest as well:
    https://github.com/lgrignon/jsweet-cordova-ionic-example
     
    Politics is a circus designed to distract you from what is really going on. So is this tiny ad:
    Java file APIs (DOC, XLS, PDF, and many more)
    https://products.aspose.com/total/java
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!