News for hackers. Stuff that matters.
Re:Using Prettier to format your JavaScript code by jeswin on Friday March 09, 2018 @03:31AM (#16550491)
The same code written with if conditions will have very similar text, will be slightly longer, have a possibility of 'return' statements anywhere in the text, and more importantly - might have embedded mutations.
Re:Using Prettier to format your JavaScript code by GordonS on Friday March 09, 2018 @03:44AM (#16550525)
... and will be much easier to instantly grok for almost everyone
Re:Using Prettier to format your JavaScript code by jeswin on Friday March 09, 2018 @03:54AM (#16550550)
I won't win this argument, and ymmv. :)

But personally, every identifier being a 'const' instead of a 'let' helps me reason about it much better, especially when the code is purely algorithmic. An alternative might be to use something like Facebook's Reason, where such code can be concise and idiomatic.

Re:Using Prettier to format your JavaScript code by serpix on Friday March 09, 2018 @02:13PM (#16554089)
And full of missing return statements and corner cases. if it only were possible to put an expression anywhere you want :(
Re:Using Prettier to format your JavaScript code by VMG on Friday March 09, 2018 @04:31AM (#16550661)
there is a tradeoff between ease of comprehension for everybody and syntactic simplicity (that is easy to comprehend for those familiar)