4 ms·
> I don't like any language or file format where whitespace matters. .... To me white space shouldn't add cognitive load. 1. there is no language where whitesp
by emmelaich 8y ago
> I don't like any language or file format where whitespace matters. .... To me white space shouldn't add cognitive load.
1. there is no language where whitespace does not matter
2. the very purpose of indentation is to ease cognitive load.
Now, you may not want it to be inflexible or mandatory but your argument needs elucidating.
- quickthrower2 8y agoOk: I don't like any language of file format where the regex s/\s+/\s/g would change the meaning of the program except in parts of the program within string delimiters, except for the parts of string delimiters which contain literal code e.g. ins ES6 `Hello ${world}`.
- emmelaich 8y agoOK, but I'd restrict the set even more to exclude voluntary indentation. I mean, you'd want that caught by style checkers anyway, even if the language didn't require it. So we're left with the cases where you'd like compact code / one-liners but are forced to use multiple lines for language syntax reasons. I'd say that that's a pretty small set of cases and long way from the phrase "I don't like whitespace sensitive languages" which you (and many others!) use. I conceded it can be annoying in Python and I do wish there was an escape route sometimes.
- andybak 8y agoSo you prefer languages way that regex only appears to change the meaning? Non-semantic white space can be deceptive. Semantic whitespace isn't.