Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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.



Ok: 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}`.


So you prefer languages way that regex only appears to change the meaning?

Non-semantic white space can be deceptive. Semantic whitespace isn't.


OK, 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: