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.
[ Parent
| on HN ]
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.