Whitespace cleanliness is only part of the problem. The much bigger issue is the fact that the ending of a block is invisible. This leads to several problems:
1. It becomes much more difficult to tell beginners where the end of a block is, because the ending of the block isn't something you can describe verbally. You have to point to it instead.
2. Students who might be prone to using the wrong number of "}" or "end" tokens to close a block will instead un-indent the wrong number of times. It doesn't prevent the kinds of mistakes that mismatched parens tend to cause.
3. When closing a block, the thing you're trying to align a prior block with might not be on screen any longer. I don't know why, but I've seen more off-by-one spacing gaffes after the close of a nested block than I ever expected to see.
That said, I don't doubt that Python arrived at the choice of whitespace blocks empirically. However, I highly suspect that the majority of the users learning how to program in the late 80's and early 90's were familiar with monospaced text, which was ever-present in most productivity applications of the day, and thus easier for them to reason about.
And to be clear, I don't really care that much about Python's whitespace blocks. I don't like them, but I'm at the age where I feel like quibbling over minor syntax gaffes is beneath me, and Python is my top "swiss army knife" language when I need a job done quickly. My only point is that I feel like whitespace blocks are a relic of the time when they were developed, and I don't think they are as beginner friendly as advertised.
EDIT: After stepping away from the post, I realized that in my perfect world, a beginner language would look a lot more like Lua than Python. Then I remembered how popular Roblox is, and how popular Garry's Mod was before that. Given the success of those platforms, there might be something to it.
1. It becomes much more difficult to tell beginners where the end of a block is, because the ending of the block isn't something you can describe verbally. You have to point to it instead.
2. Students who might be prone to using the wrong number of "}" or "end" tokens to close a block will instead un-indent the wrong number of times. It doesn't prevent the kinds of mistakes that mismatched parens tend to cause.
3. When closing a block, the thing you're trying to align a prior block with might not be on screen any longer. I don't know why, but I've seen more off-by-one spacing gaffes after the close of a nested block than I ever expected to see.
That said, I don't doubt that Python arrived at the choice of whitespace blocks empirically. However, I highly suspect that the majority of the users learning how to program in the late 80's and early 90's were familiar with monospaced text, which was ever-present in most productivity applications of the day, and thus easier for them to reason about.
And to be clear, I don't really care that much about Python's whitespace blocks. I don't like them, but I'm at the age where I feel like quibbling over minor syntax gaffes is beneath me, and Python is my top "swiss army knife" language when I need a job done quickly. My only point is that I feel like whitespace blocks are a relic of the time when they were developed, and I don't think they are as beginner friendly as advertised.
EDIT: After stepping away from the post, I realized that in my perfect world, a beginner language would look a lot more like Lua than Python. Then I remembered how popular Roblox is, and how popular Garry's Mod was before that. Given the success of those platforms, there might be something to it.