3 ms·
> Guido van Rossum came across subtle bugs where the indentation disagreed with the syntactic grouping. Meaningful indentation fixed this class of bug. Since th
by Izkata 3y ago
> Guido van Rossum came across subtle bugs where the indentation disagreed with the syntactic grouping. Meaningful indentation fixed this class of bug. Since there are no begin/end brackets there cannot be a disagreement between grouping perceived by the parser and the human reader.
Significant indentation alone doesn't eliminate this class of bugs. I'm pretty sure I've only seen this once ever, and can't remember the exact combination that caused it, but I have encountered a file that mixed tabs and spaces in a way python didn't barf over, that resulted in visual indentation being different from the programmatic indentation. I can definitely say it was python 2, not 3, so that particular instance may error nowadays.
- mmarx 3y agoMixing tabs and spaces is a TabError in Python 3, so this would definitely error today.
- bobbylarrybobby 3y agoWeird that his solution to this problem was to make a language where whitespace is significant (which makes it quite challenging to write) instead of just building a linter into Python.