Of course, it’s not just Chrome that can run ES6 natively. Support for the new standard has come on leaps and bounds, with the latest releases of the major desktop browsers all complying with over 90% of the specification (with tail call optimization being the last major outstanding feature). The current releases of both Node 6 and 7 have similarly good levels of support. Of course, most of the time we don’t have the luxury of just coding for compliant browsers – we have to support mobile browsers (which still lag being in their support for ES6) and, naturally, older versions of IE.
In my opinion, switching to ES6 is worthwhile for the syntax changes alone. You may be shaking your head, but I think things such as arrow functions, object property and method shorthands, default parameters, and template strings can really help to streamline your code. “These things are just syntactic sugar,” you might say. Taking default function parameters as an example, it might only take an extra line of code to do this in ES5 but every extra line you don’t have to type makes your code more concise and more readable. You can focus on logic over boilerplate.
So, when was the last time you wrote some ES6 code? Maybe you already use it on a day-to-day basis, or perhaps you hate the new syntax and have sworn to avoid it at all costs? Should we drop ES5 here at SitePoint and start exclusively publishing content in the modern syntax? I’d love to hear your thoughts, so please leave a comment or tweet me your thoughts @sitepointjs
Nilson is a full-stack web developer who has been working with computers and the web for over a decade. A former hardware technician, and network administrator. Nilson is now currently co-founder and developer of a company developing web applications for the construction industry. You can also find Nilson on the SitePoint Forums as a mentor.
Jump Start Git, 2nd Edition
Visual Studio Code: End-to-End Editing and Debugging Tools for Web Developers
Form Design Patterns