11 ms·
I do find properly aligned code easier to read in general, I'm not willing to give that up. The crux of the issue is poor tooling. Aligning correctly is a pain
by simias 9y ago
I do find properly aligned code easier to read in general, I'm not willing to give that up.
The crux of the issue is poor tooling. Aligning correctly is a pain because most editors suck terribly at it. For instance neither emacs nor vim align correctly when using tabs by default (they use as many tabs as they can and then pad using spaces, instead of indenting only with tabs and aligning only with spaces). If they did it would be painless to indent and re-indent.
When some of the most venerable code editors out there can't even seem to get it right I think there's no point in fighting it. Learn to stop worrying and love the space, I know I did. Or alternatively use a language like go which provides a standard tool to indent everything, make it mandatory pre-commit and never look back.
- scrollaway 9y agoYeah; the correct answer to a good codestyle is good tooling; high quality automated tooling. Things like gofmt and prettier are excellent. yapf and clang-format are also pretty good, but need a lot of set up. But I never found a single editor that handles spaces correctly. I currently use vscode with vim bindings and whenever I deal with a space-indented codebase I want to tear my hair out: I inconsistently have to hit backspace sometimes once, sometimes multiple times to get rid of an indent level in insert mode. And don't get me started with yaml, a really painful experience to edit it.
- tomsmeding 9y agoCan't vscode automatically remove an entire indentation level with a single backspace? Many editors can do that, maybe with a non-default setting, but regardless.