4 ms·
I'm seeing several people complaining about this, but I've always found changing indentation very easy. Just select then [Shift+]Tab to [un]indent. I do this re
by infogulch 10y ago
I'm seeing several people complaining about this, but I've always found changing indentation very easy. Just select then [Shift+]Tab to [un]indent. I do this regardless of the presence of braces.
- pjc50 10y agoIt's not that it's hard to change, it's just that you have to keep track of it, and if it's damaged you have to work out what it's supposed to be. In an Algol brace-blocked language (or Pascal, Verilog etc which use begin/end), you can just put stuff in the middle of a block, check that what you've just inserted is balanced, let the editor reformat it, and you're fine. Whereas if you've lost the indentation from if a: print b a = a + 1 then you have to work out all over again whether the second line is part of the block or not.
- infogulch 10y agoAh true. Thanks for the explanation. So maybe what C's missing is a standardized, popular, universal, automatic fmt-on-save. This eliminates its' issue problem with improperly indented code.
- pjc50 10y agoYeah, most projects have a coding standard and you can run indent(1) to enforce it. I don't think it's high on the list of issues with C though.