In the last few weeks I was asked a few times the question that is the title of the post. In this post I’m sharing my opinion about that question and the answers I gave to some of the people who asked the question. My hope is that this post will help people who are thinking about using ES2015 in their projects.
With Great Power Comes Great Irresponsibility
Most of the developers I met lately are eager to use all the new buzzword technologies from the second they hear of them.
“Have you heard about React? Let’s use it in our next product/module cause it sounds great.”
"Yesterday I attended a Meetup about AngularJS. This framework is so cool and I want to check how to add it to our current solution."
“I heard that ECMAScript 2015 (ES2015) specs are out since June 2015. Let’s start writing code according to that spec.”
I’m always hearing these kind of sentences and I’m always overwhelmed by their problematic implications. Let’s make it clear, I’m an eager developer like any other developers who said these sentences. I also love to learn about new technologies and how to combine them into projects/solutions. On the other hand, after so many years in the industry I learned to look at the big picture and then to calm the buzz noises. You can and should use new technologies but before you do that you need to be sure that you aren’t running forward like a blind horse.
Returning to the subject of whether you should use ES2015 today:
Making Some Assessments
- Does your team include fast learners?
- Does your team eager to learn new technologies?
- Which browsers the end users are using? evergreen browsers? IE8…?
Once I got all the answers, I told him that they should think about starting to develop in ES2015. The main reasons were:
- Their end users are using evergreen browsers which is very helpful when it comes to using ES2015. Most of the evergreen browsers already implemented many of ES2015 features and that is great. On the other hand, there are features that aren’t supported and this is why I suggested to use transpilers such as Babel and Traceur or a language like TypeScript which can convert ES2015 code into ES5 code. Another reason to use transpilers is for old browsers support. The problem with using transpilers is that they sometimes cause an overhead in development and maintenance.
Another person who asked the question asked whether to write his blog posts in ES2015 or with ES5. My answer was to write in both of the versions or to write in ES2015 and link the code to a transpiler playground to enable developers who don’t know ES2015 to translate the code into ES5. By doing that his readers will enjoy both of the worlds (ES2015 and ES5).
To help you understand some of my thoughts, I created a small flow chart:
The main thing about the flow chart is that my opinion is that the answer to the question in the post’s title is yes, but there are a few preparations that teams should do before they run and use ES2015.