JavaScript Updates in the Offing

Readers of both HTML5 Programming with JavaScript for Dummies and CSS3 for Dummies need to know about updates in JavaScript because both books rely on JavaScript to demonstrate programming concepts. The current version of JavaScript works exceptionally well for Web-based applications. You see such applications all the time. In fact, many people now use more Web-based applications than desktop applications to perform their work. For example, I’m using a Web-based application to create this post. I also envision a day when I won’t use Word to write my books any longer and will instead rely on a Web-based application to perform the task. However, the current version of JavaScript could use some improvements to make it easier to use and more bulletproof as well.

There are currently discussions for both JavaScript 6 and 7. (In fact, you can find some early discussions for JavaScript 8 as well.) The discussions are taking place in parallel to ensure that JavaScript 6 coordinates well with JavaScript 7 and to allow one version to naturally flow into the next. JavaScript 6 should appear by the end of next year (2014). Given the complexity of language upgrades, however, it wouldn’t surprise me if there were a delay or two. It’s important to get the changes right and obtaining consensus on the changes is going to be difficult because of the complexity of the changes.

With this in mind, I’ll probably ignore JavaScript 7 for right now and focus my attention on the JavaScript 6 changes. Obviously, if someone wants to talk about JavaScript 7 (or even version 8), I’m all ears. I always want to hear your viewpoint on looming upgrades. However, the focus for me now is on using JavaScript 6 to make the coding examples in my books better.

The big news for JavaScript 6 as far as I’m concerned is the implementation of modules. Using modules will make it a lot easier for developers to share code. The specification contains a good deal more than modules, but the feature most developers are focusing on is the use of modules for sharing code in ways that the current use of APIs and other code sharing techniques won’t address. In fact, the essential goals for modules are:

 


  • Get rid of the need for global variables
  • Make it possible to refactor global code as modular code
  • Reduce the effort required to use JavaScript module systems
  • Speed compilation
  • Simplify JavaScript applications
  • Improve JavaScript usability
  • Define a standard protocol for creating and using libraries
  • Make browser and non-browser environments more compatible
  • Reduce the work required to load external modules asynchronously


Some of these goals are pretty hard to understand right now and a few of them are only in the discussion stage. However, some browser vendors, such as Mozilla, are already discussing how JavaScript will work in their applications. It won’t be long and you’ll want to start thinking about the functionality that JavaScript 6 could add to your applications, even if you don’t implement this functionality immediately.

I’m convinced that the future of development lies with environments that allow you to create one application that runs everywhere. No, desktop applications won’t go away for quite some time (or possibly ever), but if you want to be involved in the technology that will dictate future application requirements, then you need to start considering releases such as JavaScript 6. Let me know your thoughts on this upgrade. I’d also love to hear your questions about it at John@JohnMuellerBooks.com. I’ll use any really good ideas/questions for future blog posts.