3 ms·
You say this, and get points, but I'm not sure what you mean. I've written Python and gotten each new line to automatically indent to the proper point, with a f
by crystalis 16y ago
You say this, and get points, but I'm not sure what you mean. I've written Python and gotten each new line to automatically indent to the proper point, with a functional backspace that unindents the appropriate amount. I've then copy-pasted blocks with several different indentation levels that were automatically adjusted to the surrounding code, with the possible exception of an error corrected by a single keypress.
To my knowledge, this is no worse than the expectation for a braced language, but much better than the worst case for a braced language.
If you mean something simpler than I've taken you to mean, e.g., the conversion of a whitespaceless C program into a whitespaced one, I concede you are mostly correct (';' still works in Python), but I must admit I would still not yet see your point.
- maw 16y agoIf 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.
- crystalis 16y agoWhy does that matter? 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.
- maw 16y agoOnce I've placed my closing braces, I'll never need to think about it again, unless and until I restructure that piece of code. It's got nothing about saving keystrokes. And now, back to working on pass-infested Python code.