Top Contributors

ES6, to transpile or not to transpile?

Sometimes I think I've been writing code for too long already.
This kind of thought comes when things like CoffeeScript and TypeScript make me unconfortable.

I can't stop thinking that I'm adding a layer of complexity and abstraction instead of simplifying my code.
Because of this I actually never used neither of them in production code.
I prefer to make sure my team mates know JavaScript properly instead of putting a barrier between them and the language.

Now the new ECMAScript6 (ES6) hype is all over the place and a new breed of "converters" emerged. They call them Transpilers.
The most known is probably 6to5 (now Babel) but Traceur also has its place in the scene.
Both accomplish the same thing, allow you to write today your applications using the new ES6/ES7 features and have them converted into the generally supported ES5.

Although it sounds wonderful, I feel the same way about it as I feel about CoffeeScript and TypeScript.
I still don't trust the conversion process enough to use it in production and make a whole team rely on it.

What about you?
Rank: Prodigy

Expert Comment

COBOLdinosaur2015-03-03 10:04 AMID: 147235
I generally avoid adding layers of abstraction.  Most of the time I don't even use jquery unless the scripting is extensive enough to justify downloading library to save writing a couple more lines in js instead of jq.  As for working in anticipation of new standards; I prefer not to use anything other then my own ability to work at a primitive level, and I would never let any of my developers use an abstraction layer unless they know the underlying technology well enough to do the coding without the abstraction.

If the world was fair everything would be coded in 1s and 0s.

Cd&
0
Rank: Genius

Author Comment

Alexandre Simões2015-03-03 11:21 AMID: 147241
Well, I'm pretty much leaving jQuery also but it has its virtues especially when it comes to abstract the differences between the JavaScript engines. To address these difference we need to write the same kind of code anyway...

I also believe that sending data to be processed in the browser is better than processing it in the server.
Users are sitting ducks with unused CPU and Memory power. Using this power instead of growing the server-side infrastructure is something that sounds like music for mine and my clients ears :)
As client-side technologies evolve, rendering HTML on the server makes every day less sense to me.

and I would never let any of my developers use an abstraction layer unless they know the underlying technology well enough to do the coding without the abstraction
Here I fully agree and I've been struggling a lot in my current project to convince the managers that the front-end devs should be trained properly but there's never enough time and after all, "it's just JavaScript" they say!...

Anyway, this thread is about using ES6 and transpiling it to ES5... or not :)
0