5 ms·
The problem is that Python encourages this "it's all cool, man" syntactic mindset. "Just indent your code the natural way, don't worry about all that extra synt
by brundolf 5y ago
The problem is that Python encourages this "it's all cool, man" syntactic mindset. "Just indent your code the natural way, don't worry about all that extra syntax like curly braces." And then it comes back to bite you when your "formatting" causes syntax problems.
People are used to the idea of explicit delimiters, at least to some extent, thanks to punctuation. People are not at all used to whitespace having syntactic meaning. You can put as many spaces as you want between words, or sentences, or paragraphs, and it might look weird but it still means the same thing.
Semantic whitespace isn't a reduction in syntax, it just hides the syntax to fool you into thinking it isn't there, until it goes wrong and you suddenly have to debug it.
- akhmatova 5y agoThe problem is that Python encourages this "it's all cool, man" syntactic mindset. It's not a problem, it's just a tradeoff. Like 97 percent of all the other differences between programming languages. As to whitespace in Python -- it was counterintuitive at first, but once I grokked the rationale behind it, I've never been tripped up by it (to an extent that it would slow my thinking for more than a second or two). Every language has random $foo that you have to get used to and step around once in a while. If you don't like Python, fine, go back to C and bash. They'll be happy to welcome you back with open arms.
- smegsicle 5y ago> rationale behind whitespace in Python it doesn't seem simpler, and any argument that it's faster or easier to type seems to fall apart the first time you need to paste code across different indentation levels, right? what's the upside?
- akhmatova 5y agoWhich, given the universal consensus to use 4-space indentation in mature projects, basically never happens. What's the upside? Readability. And freedom from silly debates about which indentation style is best.
- akhmatova 5y agoAlso: You can put as many spaces as you want between words, or sentences, or paragraphs, and it might look weird but it still means the same thing. No -- whitespace definitely has meaning in natural languages. It doesn't usually change the meaning much -- but it does affect it (where meaning of course includes tone and consideration for the reader's experience). Especially when it comes to the use of space between sentences and paragraphs. As any good writer will tell you.
- codeflo 5y agoEven indentation has a meaning, usually quotation.