EcmaScript 5 versus 6

We create open-source because we love it, and we share our finding so everyone else can benefit as well.


EcmaScript 5 versus 6

Still to this day I continue to hear professionals complain about ES6, and watch followers hold the same opinion because of a close-minded programmer. Even being new to JS, I’m not new to programming, and this is the first time I’ve seen people completely retaliate against their own language. In this article I plan to cover what I’ve experienced, and why I think people with this mindset are doomed to fail.

Unfortunately I saw the resistance with JavaScript first hand, because when I first started writing JavaScript back in 2015, I started with ES6. For months I avoided ES5, but when I went back to focus on the basics I was forced to use it. Even though I disliked the sight of ES5 and it’s messy code, I found myself enjoying it once I really started working with it. This is the same thing I have been hearing when people try ES6 for the first time. While it looks “alien”, users love the syntactic sugar, as well as the classes. I remember writing my first prototype constructor in ES5, and thinking, “Wow, this sucks compared to ES6. Why would anyone prefer this over it?”.  Like I would with other languages, I took the time to learn both sides, and moved forward.

Before I continue I want to point out that programming languages will always evolve, and if you resent and resist the changes, then you are definitely in the wrong business. Seriously, if you want to be or continue to be a programmer, objecting to change is not the way to continue your career with that language. Every language goes through changes for the demand of it’s users, and it’s applications. I can understand that JavaScript was hit with a wave of innovation that made the demand for the impossible, possible. Instead of being a browser-only language, JavaScript has become a back-end language, where object oriented programming even in a prototypal language is in need.  Sure, you want to stay as a front-end developer, but almost all browsers are ES6 (es2015) ready. If you think everything will continue to revolve around es5, you are most likely delusional. Sorry, but that’s just how it goes.

To ease the minds of many, I would like to point out with ES6, ES5 syntax is not phased out, so you can continue how you would normally, and at least use ES6 for some of the sugar. Like the founders of Elm always say, “Write just a little bit of your project with it, and then a little more. You do not need to refactor the entire project, just add a little bit at a time”. This can be said for ES6 just as well, except with ES6, you can mix ES5 in it. If the sight of task-runners, and bundlers is what is turning you away, simply look around GitHub for boilerplates. You can clone, run, and done. Learn it when you absolutely need to, or have the time.

To make a long story short, I highly recommend learning ES6, as well as always learning about how your language evolves when the official changes are released. With ES 2015, the syntax makes for some great code, allowing for easily written functional programming, and easily readable code. The class ability allowing for the easily written ability to create entire closures, with the ability to easily expose any method to the public with a single keyword , as well as many other patterns (like ‘let’ singletons). Then you have the built-in Promises and Generators that help create amazing asynchronous control flows when working in redux, or Node.js. There’s just so much possibility, and I’ve only skimmed the surface.

To learn more about ES6, I highly suggest checking out this great Article over at Medium.


No Comments

Add your comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.