|
|
|
|
|
by lelanthran
1262 days ago
|
|
> If you're talking about failing to determine blocks which are NOT correct Python, then I don't have a problem with those failing to be correctly indented under copy/paste. Then maybe you shouldn't have replied to parent who said: >> Yes it forces clean indentation, but it gives the writer the burden to take care of it. That sucks. Let the computer do the work. > The vast majority of use cases would still be well served. Well, sure, because the burden for ensuring the code is correct falls onto the programmer, whereas with other languages we can just let the computer do that. |
|
I replied to dismiss your assumption that adding delimiters as '}' or 'END' will ensure the correctness of code in a way that a code with indentation delimiters can't do. It's similar to saying that in, a language where statements are not finished by semicolon, it's not decidable where sentences end, so this forces the developer to decide on the correctness of statements. OF COURSE there are ways to define where a statement ends without adding a semicolon to each one, just like there are ways to decide where blocks end in an indent-based programming language; they are embedded in the language syntax.
Heck, C is notorious for producing incorrect code for NOT using meaningful indentation and relying on delimiters instead. If you write:
And then you expand the else block: Then function(3) will be compiled out of the if sentence, when it's clearly part of the else block.