I’m typically not bother too much by the whole tabs vs spaces, but for some reason, it sort of got on my nerves last week (I do most of my editing in vim where it doesn’t really matter, but I’ve been doing some stuff in SubEthaEdit latetly) and got me looking at some of the back and forth…
- Tabs versus Spaces: An Eternal Holy War. – jwz’s essay was one of the original ones I read while a friend persuaded me to switch to spaces
- Indent with spaces, not tabs – lots of reasons, plus links to coding conventions which specify spaces only
- Why I prefer no tabs in source code – another good essay, plus links to a lot of discussion
- Spaces considered harmful – mostly argues why tabs aren’t bad and that spaces are “morally wrong”.
- Why I love having tabs in source code. – rebuttal to the above, has some pretty good points, but I’m not convinced that formatting is preserved even if you use tabs only for initial indents (especially if you’re concerned line wrapping)
Anyway, while the last article actually got me thinking, in the end, I decided to stick with spaces. Tabs just introduced more complexity, and mixing tabs/spaces leads to all kinds of wonkiness when done improperly. I did decide to be a bit more aggressive about using retab if I got bothered again…
For reference, my vim settings for tabs:
" interpret tab as an `indent' command instead of an insert-a-tab command set softtabstop=2 "indent with two spaces when hitting tab set shiftwidth=2 "expand all tabs to spaces according to shiftwidth parameter set expandtab " mod%2 to ignore tabs set tabstop=2