2 ms·
A not insignificant number of functional languages disagree. You often read functional code from the inside out, which basically means you're reading right to l
by scuff3d 1y ago
A not insignificant number of functional languages disagree. You often read functional code from the inside out, which basically means you're reading right to left as you move up function calls.
For the record though, "it's more readable" is a much better argument then "LSP mad"
- Philpax 1y agoRight-to-left is equivalent to left-to-right in this regard: you're still reading in one linear direction, as opposed to Python, where you have to read inside-out and revisit later parts of the line to correctly understand previous parts of the line.
- scuff3d 1y agoFair enough. And like I said, you're argument is certainly better than the article's. I'm not really a fan of list comprehensions, I usually just use for loops. It does seem consistent with Pythons syntax though. For loop is `for item in items` and comprehensions have 'item for item in items'.
- xigoi 1y agoNim has a macro in the standard library that allows you to use the actual for loop syntax as a comprehension. let primeSquares = collect: for n in 1..100: if n.isPrime(): n * n