ES6 is great, until it’s not
medium.com
medium.com
Brendan Eich has more or less apologized for JS and said it was written in 10 days meant to do things like make text flash.
The goal of front end has always been "this feature sucks less than before!"
Wow a let variable to fix scope! Arrow operators to dekludgify callbacks! Lol CLASSES WOW is this heaven?
Web Assembly is my hope for getting rid of opinionated langs in the browser and allow in langs built on decades of experience, which will make front end reasonable like the rest of the sodtware world
Not all features increase complexity. The fat arrow functions are more easy to reason about as "this" can be understood more locally. When transpiling the code may be larger but in the long run maintainability should be better.
I found the Crockfords talks on ES6 (e.g. https://www.youtube.com/watch?v=vJKDh4UEXhw) useful as a guidance what could be a minimal set of sane features.
create_project(prj_name).then(project=>addTeam(project, team_name)).then(team=>addMember(team,name))
The main point of the article was in that using new JS features blindly may cause the significant problems, not with readability, but with the script size and the running time of the code after it’s transplied to ES5.Its not just about which language is used, but how its used.
ES6 has brought on many necessary improvements.
Obviously I can't read this mess easily
( { ...state, [ siteId ]: { ...state[ siteId ], [ postId ]: {
requesting: false,
success: false,
error,
} } } )
but this is pretty easy to read ({
...state,
[ siteId ]: {
...state[ siteId ],
[ postId ]: {
requesting: false,
success: false,
error,
}
}
})
Though even easier to read would be to use icepick import { setIn } from 'icepick';
setIn(state, [siteId, postId], {
requesting: false,
success: false,
error,
});