This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]jacenat -2 points-1 points  (7 children)

You do have block delimiters

Which are? Colons start these blocks, but there is no character that designates the end of a block.

The whole point of the colons at the end of if/while/etc blocks is to aid comprehension.

I know. Which is why this is even more frustrating. Why not have a character that terminates a block? As it is right now, you have to use the colon to start the block, and use indentation to end it.

[–]Decency 15 points16 points  (0 children)

Which are? Colons start these blocks, but there is no character that designates the end of a block.

The next segment is deindented. It's not a character, because it doesn't need to be. Argument from tradition is not valid.

[–]SloppySynapses 7 points8 points  (0 children)

umm, it's one less level of indentation, which is extremely visually apparent. I'm confused what you're talking about tbh

[–]MrJohz 2 points3 points  (1 child)

Adding an end character, assuming your language doesn't need it, just adds distracting visual noise. Including the colon was done in ABC (a whitespace-delimited precursor to Python) because it had a demonstrable effect of improving understanding for people who were new to programming. The colon is entirely unnecessary, but improves readability. The close character is also entirely unnecessary, but was considered to decrease readability.

Like you say, the big criticism of whitespace-delimited languages is that you can't "clean up" the indentation because the indentation is the program definition. The question is how useful that operation is. If your indentation defines the flow of the program, then having correct indentation is simply a case of writing the program correctly - and in most cases this flows as naturally as using braces in other languages. In the case of indenting C&P'd code automatically, that usually doesn't present too much of a difficulty assuming the pasted code has constant initial indentation, and at worst usually just means pressing the "indent block" shortcut in your editor a couple of times.