|
|
|
|
|
by maw
5835 days ago
|
|
If you write code like this: if x:
# do stuff
# do other stuff
Your indenter will not know where to put the third line.In languages whose blocks are closed using nonwhitespace the problem doesn't exist. Your indenter just has to push everything as far to the right as it can, and problem solved. It's nice that your editor gets copy and paste right, but it doesn't and indeed can't decide how to indent your code, something that works in every other language I've dealt with. |
|
In brace language:
if (condition) {{ code_1 }} code_2
In Python:
if (condition):\n code_1 \n^H code_2
Unless your editor also knows when to place your close braces, and, haha, it doesn't and indeed can't, you have not even won a keystroke.