3 ms·
The ambiguity that EMCAScript 2015 added really makes mentally parsing code a lot harder, and not what I would describe 'beautiful'. I've learned to accept it,
by russellbeattie 11y ago
The ambiguity that EMCAScript 2015 added really makes mentally parsing code a lot harder, and not what I would describe 'beautiful'. I've learned to accept it, but => functions are especially hard to see - it makes function definitions into Perl-like line noise, which I really don't think was worth the 4 characters savings. e.g. function(a){ and (a) => { . *functions as well is just badly designed. JavaScript would be well served to emulate Python's model of less options/more clarity, not pandering to uber-geeks who want to use as few keystrokes as possible for whatever reason.
- jack_jennings 11y agoThe implicit return in the last variation of arrow functions presented is a terrible implementation mistake and not a win for clarity nor consistency.
- jahewson 11y agoI couldn't disagree more about arrow functions: x => this.y + x Is almost pure signal, compared with the noise of: (function(x) { return this.y + x; }).bind(this) I know which piece of code I'd rather maintain.
- btdiehr 11y agoArrow functions are immensly useful, and the lack of some of this syntax for a language which naturally lends itself to a functional approach was so jarring that coffee-script grew to immense popularity because of it. Like any sufficiently popular language, literally any choice will be met with a vocal group of people who dislike every single aspect of it. ES6 was a long time coming, and has made Javascript much more legible to read as well as making it easier to write.