3 ms·
> You don't end up in a situation like this contrived example: Modern languages repair this with mandatory block braces: {C style} (Rust, Go, Swift...) or Modu
by Netch 6y ago
> You don't end up in a situation like this contrived example:
Modern languages repair this with mandatory block braces: {C style} (Rust, Go, Swift...) or Modula/Ada style (if x then foo else bar end). C style is easier for editors.
> What's your issue with significant whitespace?
1. Many cases when leading whitespace is still spoiled, including editors (which use can't be avoided due to corporate tool limiting), web formatters, etc. Last decade spreading of mobile-aware tools made this worse.
2. With grouping by indentation, it's hard to determine block start if multiple blocks are ended at the same line, like:
a:
b
c
d:
e
f
p
and let's imagine the most nested block occupies 2-3 screens (not rare for configs or code, even if it is against good coding rules). You have no means to decide what block start is to be matched when you ask editor to find match.
I code in Python continuously since 2004 and I deem grouping by indentation is bad idea. Not fatally bad, of course, but with explicit grouping it would be a bit better.