X

Geertjan's Blog

  • June 17, 2015

"Everything a Java developer should know about the JavaScript landscape"

Geertjan Wielenga
Product Manager

For a few months I've been working on a presentation aimed at Java developers, to introduce them to the brave new world of JavaScript, not JavaScript the language, but JavaScript the constantly changing ecosystem.Why? Because this topic is something of relevance to the Java community and it's an interesting area to look at. It makes sense to examine the JavaScript ecosystem and to evaluate the extent to which its current popularity is a trend or a hype and what Java developers can do with it and maybe benefit from it in the context of their existing Java applications, too.

The story starts by looking at new enhancements in HTML (thanks to HTML5) and CSS (thanks to CSS3) and then in more detail at all the different kinds of JavaScript solutions (core libraries, build tools, application frameworks, testing frameworks, and component suites) that a Java developer should be aware of when beginning to get their toes wet with JavaScript. After that, a brief look at various kinds of transpilers, e.g., CoffeeScript, TypeScript, Dart, GWT, Vaadin, and DukeScript. Yesterday I presented that story for the first time, at a session organized in Bodegraven in the Netherlands by Blue4IT, a great organization (always on the lookout for new local developers to hire) which recently hosted Adam Bien and will be hosting Martijn Verburg in October.

The demonstrations done during the session:

  • HTML5 as an 'application framework' via new elements and attributes, see the HTML5 Fun Pack.
  • Responsive CSS via media queries vs. Responsive JavaScript via Response.js and Foundation.js.
  • Monolithic vs Modular via Require.js, using these examples.
  • AngularJS, Knockout.js, and Backbone.js.
  • Java EE backend with JavaScript fronted, via RESTful Web Services.
  • Solid Knockout, a Knockout/Require.js template for JavaScript enterprise apps.
  • DukeScript, enabling UIs in HTML and business logic in Java instead of JavaScript.

The feedback was pretty positive. What surprised me the most was that Java developers, at least in this session, were not necessarily doing everything they could to avoid coding in JavaScript, i.e., even though it is loosely typed and has all kinds of problems, developers appeared to be quite excited about working with a new language and a new ecosystem. Several have already been crossing over to JavaScript and, sure, despite that there are problems with it, all ecosystems have problems of one kind or another, though everyone is always interested in using the technologies that are new and popular.

In particular, AngularJS is something everyone wants to start doing things with, to the extent that they haven't already, simply because there's so much buzz around it. I tried to make the case for a few alternative solutions, especially Knockout.js, since I do believe it allows for a more flexible architecture than that enforced by AngularJS. I presented DukeScript as a credible solution for those who want to continue coding in Java and it did feel like a lot of people were interested in the notion of JavaScript as an assembly language, i.e., something that the browser needs but that no developer should need/want to touch. Nevertheless, it feels to me that the new and cool technologies that run in the browser, i.e., all these various cool JavaScript frameworks, are going to win simply because there's so much energy around them and even the most hardcore Java developers don't have a problem at all in changing their toolbox, including their language, every few years or so. JavaScript is new and fun and there are not many hardcore dogmatic Java developers who would reject it out of some kind of principled objection to anything that isn't Java.

Of course, and this is the basic underlying principle to all of this, the tools and technologies you choose depend on the kinds of business requirements you have. If you're going to be creating an air traffic control system that should remain functional for the next 10 years and be operated by 6 users in a control tower, obviously you're not going to use JavaScript and the browser. However, if you're going to create a SPA primarily targeted at desktop browsers, tablets, and mobile devices, all at the same time, then the JavaScript ecosystem is the most obvious candidate for implementing your requirements. 

Anyway, let's see what happens in the coming years. There certainly is more than enough choice out there, that's for sure. 

Note: Happy to do this presentation again to any organization interested in getting a thorough overview of all the things going on in the JavaScript ecosystem.

Join the discussion

Comments ( 6 )
  • Jaroslav Tulach Thursday, June 18, 2015

    Thanks for promoting DukeScript.


  • Tim Boudreau Wednesday, June 24, 2015

    The secret to Javascript is that, as an object-oriented language, it is an absolute disaster. But it is a tolerable functional language, and if you use it that way, you can do some good things.

    Re KnockoutJS, I evaluated all the available frameworks a couple of years ago, and it washed out early due to bugs. I'm a little baffled by the amount I see you guys pushing it - seems like backing the wrong horse, rather like hg vs. git.


  • Geertjan Wednesday, June 24, 2015

    Maybe evaluate all the available frameworks again (and publish that research somewhere)? Things change a lot in a couple of years. Odd that you're a little baffled when someone proposes something other than AngularJS as being usable in the JavaScript ecosystem.


  • Geertjan Wednesday, June 24, 2015

    PS: Talk to Jaroslav Tulach about KnockoutJS, which is the basis of DukeScript...


  • Paul Preiss Saturday, June 27, 2015

    Sounds like a great presentation. Would love for you to give it to our architect members as Iasa. Would you be interested?


  • Geertjan Saturday, June 27, 2015

    Definitely! Drop me a mail -- geertjan dot wielenga at oracle dot com


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha