3 ms·
Well, significant whitespace will play the role of braces, right? You can't have your editor "fix" the braces, either -- the author has to put them in. In the
by hibbelig 9y ago
Well, significant whitespace will play the role of braces, right? You can't have your editor "fix" the braces, either -- the author has to put them in. In the same way, you can't have your editor "fix" the indentation -- the author has to put it in.
But with braces, you can do consistency checks, such as that they are properly nested. In a similar way, you can do consistency checks with indentation. For example:
line 1
line 2
line 3
The third line is wrong, the transition from line 1 to line 2 introduced an indentation step, and the third line is neither left nor right.
- z3t4 9y agoI find adding braces much easier then managing white space though. For example commenting out code, adding branches, removing branches etc.