3 ms·
I didn't write the code in question, but I've done the same thing before. Usually it's because I'm cursoring up and down a file, see some lines I want to commen
by PhasmaFelis 11y ago
I didn't write the code in question, but I've done the same thing before. Usually it's because I'm cursoring up and down a file, see some lines I want to comment out, and don't bother moving over to the start of the text first. Syntax highlighting greys out the comment, so it's not visually obtrusive. (Which is another reason I'm baffled that Atom and Sublime both misbehave this way--they've got syntax highlighting! They're already aware of block delimiters! Why don't they apply that knowledge to code folding?)
And I understand there are other reasons to not indent. In some languages, it's conventional to have certain kinds of declarations come at the beginning of a line, even if they're inside a block. (I think C++ does this, but I haven't used it since college--anyone want to comment?)