Hesitant to learn ES6 due to the backwards compatibility issue

Seeing it in the beta my first thought was “okay, best to learn the latest/newest standard.” Then I saw this:

"Many ES6 features are not backward compatible and will only work in an ES6 JS engine. If your code runs in a browser, it will either only work in the newest browsers or you will have to wait until your entire browser support base is up to ES6 (years from now). If your code runs in something like node.js or if it’s a plug-in for a specific version of a specific browser, then you have better control over the JS engine and can likely use ES6 features sooner. "

I now feel ES6 knowledge may be a liability more than a benefit to a new JS learner. Does anyone disagree? If so, why should someone learn ES6 right now before it can safely be used on the front end?

The ES6 standard was officially ratified almost 2 years ago (June 2015) and it is very well supported by all major browsers and Node JS. Plus, Babel can bridge the gap for you if you need to support some older browsers.

IMHO, if you are working with JS today, you should be using the current version (which is actually ES7, by the way).

Yes, I disagree.

The browser vendors are constantly updating their browsers with the newest features for JS.

There are sites like www.caniuse.com where you can search for features you want to use and see what the browser suppport is like. How long/if they are supported by browsers and what the world wide support stats are like.

I recently redesigned my business website. It no longer supports IE at all. Site doesn’t work. MS stopped making/supporting that browser. So did I.

If you really, really want to support users who are not updating their browsers, you can use build tools like babel.js to “transpile” the code from ES6 to ES5 compatible syntax. Of course, that means you have to use a build process which includes babel.

I didn’t, which is why my site doesn’t support IE anymore. I may get around to it sometime, but I’m honestly not bothered by the fact that my site doesn’t run on a no longer developed/supported browser.

There’s definitely no reason to prevent yourself from learning and using the language. In fact, it would be a detriment for you not to, if you are looking for a job. Tools like babel.js are used extensively in professional environments.

1 Like

Just use babel to transpile to ES5 code so there is pretty much no difference. With transpiling you get the benefits of the ES6 features with the more compatible code of ES5. I also was hesitant to give ES6 a try thinking transpiling would be too much work but it was simple. I think you can even use babel directly in codepen if thats what you are using.

I was already done with my front-end certificate though. ES6 is also very similar to other programming languages I am more familiar with which is the main reason I wished I switched sooner. I still think understanding the strange things like var scoping is something people should learn though so maybe it would not be bad to wait till you are more familiar with javascript before going to ES6.

Also, I don’t know what a job situation looks in your area, but where I live almost every job posting lists good grasp of ES6 as a requirement.