But most of the time this is in the context of Node.js development, and in every case I use Babel.js to turn the end result into ES5 code.
I'm perfectly comfortable with using ES5, because as a freelancer/contractor I often have to do so. But I really miss the ES6 stuff and the more I use it, the more time it takes me to 'switch' to a mindset where I'm only allowed to use ES5 functionality.
Nonetheless, it strikes me as really odd to actively prefer ES5. Having worked with Ruby and Python (among others), ES5 feels limiting for no good reason. The only rationale I can think of for prefering ES5 is nostalgia.
Could you elaborate why you don't like the 'perl/python' style changes? Because I truly do not understand why one would choose to limit oneself to things like .bind(this) instead of the different forms of arrow functions that make functional-like programming so much easier. And I've found that the best part of JS is that it's decently functional.
Edit: I would agree when it comes to the new 'class' keyword though. I'm not a fan of that.
It's really just a style preference. I enjoy the "look" of C-family code.
>why one would choose to limit oneself to things like .bind(this)
I know 'this' is a source of pain for a lot of people. For me, I see it a source of flexibility. I've found the ability to control the context at will to be a huge benefit. It's a feature I miss when I'm writing in other languages.
But that's why you can still use the regular functions... I don't quite understand how having the added option of a more concise syntax with automatic binding to the surrounding context is less flexible. I often find myself using the regular function declarations to differentiate between different sorts of functions. The arrow notation is opt-in.
Or is your issue that when you work with other people's codebases, you have no option to opt-out?
If it's helpful: the current stable node (4.x) already supports ES6 out of the box.
- my project contains jsx files, which currently are compiled into .js files which feels a bit messy.
- I'm seriously considering using ES7's async/await functionality, which is not supported by node yet.
- and most importantly: node's ES6 support is incomplete. In particular, I miss default function parameters and destructuring assigment.
Using Babel would solve all these issues, and I could simply remove Babel once support is sufficient.
The extra syntax around arguments (defaults and rest) is useful. ES5 does support function overload, but often ends up some hard to read hacks. Libraries commonly have only a few functions, but the functions have flexible signatures. So the first thing you see when trying to read their source is a jumble of argument parsing.
That said, ES6 can end up with some poor performance. For example, template literals are almost 10x slower than just plain string concatenation. But if you are concerned with performance, writing JS may not the be the best choice.
"All of the syntactic sugar stuff changes the look and feel of the language too much for my tastes."
I think it brings it into line with how the language is being used in production these days. Modules, generators etc make the language more beautiful, powerful and easier to maintain.
Not a JS developer, but most of my friends who are have been transitioning to Typescript. The road is bumpy, but they say once you get some syntax stuff down, you're good.