News for hackers. Stuff that matters.
Re:ES6 is beautiful by jbergknoff on Thursday April 07, 2016 @03:03PM (#11449721)
You're exactly right. Arguably worse than ugly, unnecessary and difficult to parse are that many of these things are difficult to research with a search engine. For example, `const { user, post } = this.props;` there is nothing to plug in to a search engine (and the meaning is not obvious, even to somebody with plenty of experience in ES5). Same thing with `arr1.push(...arr2);`.
Re:ES6 is beautiful by btdiehr on Thursday April 07, 2016 @03:06PM (#11449744)
Destructuring assignments are extremely useful, especially within function signatures.
Re:ES6 is beautiful by th0br0 on Thursday April 07, 2016 @03:11PM (#11449776)
Without knowing the type of what you're destructuring though, that's quick to land you in some type of undefined hell.
Re:ES6 is beautiful by btdiehr on Thursday April 07, 2016 @03:21PM (#11449862)
Why wouldn't you know what your destructuring?

`({ id, option = true, name = 'unnamed' }) => // ...`

replaces

``` function(userObject) {

  const id = userObject.id;

  const option = userObject.option || true;

  const name = userObject.name || 'unnamed';

  // ...
} ```

I think this comparison speaks for itself. In pre-es6 code bases you TONS of code that looks like the second.

Re:ES6 is beautiful by bengale on Thursday April 07, 2016 @03:06PM (#11449741)
Come off it, destructuring is hardly unique to javascript.
Re:ES6 is beautiful by nly on Thursday April 07, 2016 @03:15PM (#11449811)
What syntax would you recommend/prefer for unwrapping 'props'?
Re:ES6 is beautiful by dandare on Thursday April 07, 2016 @03:38PM (#11450002)
This is a real problem for me these days. I see a new syntax in someone else's codebase and it is very difficult to google it.
Re:ES6 is beautiful by Keepo on Thursday April 07, 2016 @04:05PM (#11450200)
Take a look at this site http://es6-features.org/ there is even comparison ES6 vs ES5 code. You can just go over every feature really fast a then you may get rough idea where to look next time you feel lost.