3 ms·
As pointed out, in written language, structural units (like chapters, paragraphs, bullet-point lists...) are usually finished with... distinctive whitespace (in
by necovek 5y ago
As pointed out, in written language, structural units (like chapters, paragraphs, bullet-point lists...) are usually finished with... distinctive whitespace (indentation or vertical space).
Beginnings are usually more prominent (more whitespace, bigger fonts and different alignment, or introductory sentences with colons for lists), just like in Python.
I am only saying that there's no need to make up arguments against significant-indentation. You can like how it looks or not: that's pretty subjective, though.
The only two objective arguments for either side I can see are:
* Terminating "end" or "}" are superfluous if you are already indenting code.
* Re-indenting a block with no termination indicator can lead to subtle bugs (at least more of them compared to when an indicator for block end is present).
- chillfox 5y agoWritten language usually don't have paragraphs inside paragraphs. In programming things are frequently nested several levels deep. This is the key difference that makes a termination character/word important I think.
- necovek 5y agoThey do have it. Quotes (esp multi-paragraph ones) are usually indented another level in. So are nested lists (imagine if lists on different levels of nesting only used different bullet characters). So are mathematical formulae. Or table of contents. Or bibliographic references. Tables in general are a special case of horizontal spacing that matters. Figures and images in text. It's not as common because writing is not all hierarchical all the time (or at least, lots of space would be wasted if entire chapters/sections were indented one level extra), whereas programming is heavily hierarchical with shorter "blocks". Horizontal indentation is the most common way to express that hierarchy, including in programming languages that use block termination indicators — indentation is used to help humans parse the code, termination indicators are there to help computers parse it. You are making it sound as if you are not making use of indentation when programming: I thought the only complaint was about it being significant.