Re:15 years trying to make everyone separate HTML, JavaScrip...
by dclowd9901 on Tuesday December 20, 2016 @11:57AM
(#13221580)
It's a comfort thing, for sure. I've only started writing more with destructuring assignment recently (it's part of our code style guide at my new company), and it's doing things like forcing me not to use a different variable name for something that's already been defined. It's also forcing me to do more FP (since our stylguide also forces usage of `const`), which has actually made my code my more readable and maintainable (consistent naming, single-responsibility in functions, etc). Once you get used to the new syntax, it's a breeze to read and understand.
Well, once you understand a statement like this anyway:
`store => next => action => next(action);`
Re:15 years trying to make everyone separate HTML, JavaScrip...
by mercer on Wednesday December 21, 2016 @09:27AM
(#13229310)
That's good to know. It does feel like a powerful feature that's worth mastering.
I mean, despite the risk of making things complicated, I use ternary operators all over the place...
I really like how it can reduce a number of tasks to less code, but it's the most common thing that trips me up when I read React or 'ESNext' codebases. It feels like ternary operators on steroids, with all advantages and disadvantages magnified.
Perhaps I just need to get used to it.