Skip navigation

ECMAScript 6: Coming Soon to a Browser Near You!

For many years, JavaScript was the language that everyone love to hate. Despite the similar names, JavaScript had almost nothing to do with Java, other than sharing a loose ancestry in C. JavaScript seemed to be a toy language, limited to doing pretty things in a browser without any real language features, and any attempts to do anything non-trivial amplified the browser incompatibilities of the infamous browser wars. In short, it was a mess.

But what a difference a decade or two can make! Ajax gave JavaScript a reason to exist, and jQuery made programming with JavaScript a joy again (as if it ever was a joy in the first place). Now JavaScript is used for robust server software (thanks, NodeJS!) and enterprise-class applications. Douglas Crockford’s JavaScript: The Good Parts introduced us to all that is beautiful in the language and helped us work around the warts. And now JavaScript is a regular member of the TIOBE Index of top programming languages. This ain’t your gramma’s JavaScript anymore! We’ve gotten to the point that it is nearly inconceivable to do serious Web development without JavaScript, no matter how powerful HTML and CSS3 get.

And now, after years of hard work by the ECMA standards body, version 6 of standardized JavaScript, called ECMAScript 6 or ES6, is poised for final approval, which some people expect will happen by this summer. This is probably the most inevitable set of standards the Web has ever seen, with immense momentum building behind this latest update to JavaScript. All the major browsers have long since begun implementing the more stable parts of the update, and tools and libraries, including Microsoft’s TypeScript, have provided early implementations of some of the best upcoming features. The time has come to start learning this new JavaScript, because there is a lot to learn and love!

It’s important to understand that the ECMAScript standard deals with language syntax, types, object-oriented features like prototypes and inheritance, and a standard library of extensive built-in objects and functions. This is all separate from various other standards--most of which are the domain of the World Wide Web Consortium (W3C)--like HTML, the document object model (DOM), and cascading style sheets (CSS). Nothing much has changed in the relationship of the JavaScript language and those other standards, other than ES6 will help make JavaScript a more general-purpose programming language with modern language features.

ES6 is a major upgrade to the language, the first since 2009, but with a strong emphasis on backwards compatibility. Any code you have running successfully today in the latest versions of the major browsers will almost certainly continue to execute just fine in fully ES6-compliant browsers going forward. You’re likely to already have encountered any compatibility issues if there are any.

In coming months, I’ll explore some of the more significant features in ES6, including those that make it easier to use the language for object-oriented programming. One of the biggest changes is that you’ll soon be freed from the clunky prototype to simulate class definitions and constructores. ES6 provides a class that, just like other “real” programming languages, let you encapsulate behavior and data inside discrete programming objects, complete with constructors, properties, and methods, and support for inheritance and overrides. Although prototypes and concepts like closure have long been the gateway to try JavaScript mastery, the support for classes will make it far easier to create rich, robust, and maintainable enterprise-grade JavaScript code.

Along the way, you’ll learn why I’ve become obsessed with this latest incarnation of JavaScript. There is a lot there to like!

If you want to learn more about the upcoming ES6 features, Mozilla recently started an ES6 in Depth set of articles that promises to be a good introduction to the best of what’s new in weekly bite-sized chunks.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish