Indentation sensitivity is ugly.
With a bracket, i can easily read the scopes, block of codes. With indentation, it's harder.
With a bracket, i can easily read the scopes, block of codes. With indentation, it's harder.
- Step 1: Find open bracket
- Step 2: Find closed bracket
With indentation, the algorithm now becomes:
- Step 1: Find something which seems to open a scope.
- Step 2: Scan all indentation level until it's done.
The difference is huge here.
I have a different algorithm:
- Find first indented line
- Find next unindented line
If that does not work for you, your code is bad.
Step 2: Find the first place where the indent becomes lower.
It's not hard, human vision is naturally designed for this. What is hard is finding a matching bracket when the code is not indented properly.