4 ms·
Both of these things are way too hard to read and whilst they might be pretty you're massively screwing over whoever has to maintain your code lol
by morrbo 9y ago
Both of these things are way too hard to read and whilst they might be pretty you're massively screwing over whoever has to maintain your code lol
- saranshk 9y agoAgreed. Formatted code does not allow you to write stuff that is difficult to understand/reason about
- jeswin 9y agoThe 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.
- GordonS 9y ago... and will be much easier to instantly grok for almost everyone
- jeswin 9y agoI 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.
- VMG 9y agothere is a tradeoff between ease of comprehension for everybody and syntactic simplicity (that is easy to comprehend for those familiar)
- serpix 9y agoAnd full of missing return statements and corner cases. if it only were possible to put an expression anywhere you want :(