2 ms·
I just think they're redundant. Indention in non-Python code is 100% aesthetic; it doesn't affect program behavior, we just do it because it helps us non-compi
by k3n 14y ago
I just think they're redundant.
Indention in non-Python code is 100% aesthetic; it doesn't affect program behavior, we just do it because it helps us non-compilers understand the code. And if you follow most any sane coding standard, indention will always be congruent with braces.
So, you're essentially attempting to convey the same concept -- program structure -- via 2 different mechanisms: tokens (curly braces) and indention, where of course the former is required, while the latter is the fodder of more flame wars than anyone cares to count. The sad thing is, these flame wars over code formatting are the most contentious to humans and yet the least meaningful to the compiler.
One solution would be to remove the indention -- hey, we already have the tokens informing us of the lexical code boundaries...but this produces unreadable code. The other solution is to remove the tokens; since we as humans will naturally structure our code in block paradigms, then we can piggyback on a behavior that is already innate to programmers.
- pekk 14y agoEnforcing a convention (like go fmt) will also take care of the issue. However, this doesn't end up being really different from what Python does by rejecting mixed tabs and spaces. So.
- qu4z-2 14y agoI agree with you. It seems odd that we have the structural information in our program twice: Once for humans, and once for computers. The computers are perfectly capable of understanding the human construct, so let's use that.