4 ms·
Indentation based is a pain when copy-pasting between contexts with different indentation levels, as you have to fix it up manually, which is error-prone. In la
by Georgelemental 3mo ago
Indentation based is a pain when copy-pasting between contexts with different indentation levels, as you have to fix it up manually, which is error-prone. In languages without it, you can just auto-format. (And even in an editor that doesn't support that, having a second indicator makes it less error-prone to fix manually)
- teiferer 3mo ago> have to fix it up manually Any editor written or actively maintained in the current century does this automatically for you. (Yes that obviously includes Emacs and Vim).
- rurban 3mo agoIn gdb? It's a shame gdb picked python
- jcgl 3mo agoBut that doesn't work if the indentation carries semantic meaning; you can't change the indentation without changing the meaning. Maybe you can correct syntactically-incorrect spacing (e.g. change 3 spaces to 4 spaces), but not much beyond that.
- teiferer 3mo agoThe Vim I use increases the indent of a code block when I ask it to. Just like it places a closing curly brace at the point where I tell it to. I don't see the fundamental difference between these two things.
- Georgelemental 3mo agoBut you have to ask it to, and by the right amount for every line/sub-block. If you accidentally get one line wrong, it could be a silent bug. In a language without significant indentation, as long as braces are preserved, once you are done moving code around a single autoformat will fix everything including nested blocks. And if you forget a brace, it's an error instead of a silent bug
- vrighter 3mo agono, they can't in indentation based languages. changing indentation implies changing the code. A formatter isn't allowed to do that
- floxy 3mo ago>copy-pasting Underappreciated benefit of side benefit of indentation based languages: no copy-pasta.