For the "normal" indentation (whitespace before code), tabs. That way, you can set your tab width to whatever you want, and the code that gets written will all reindent itself based on that tab width. That also happens to be the indentation that vim's autoindent code handles, at least for most languages I use.
But use spaces for the indentation used to line up multiple rows of text in a comment, when the first line of the comment started at the end of a line of code. That's because the text that you're going past has a fixed width, so if you use tabs and someone likes a different width for their tabs (e.g. 8 vs. 4), it screws up the alignment. Also use spaces for the indentation used to align e.g. comments on multiple structure members, for the same reason. You want the text to line up with previous lines, and because there are characters other than tabs before it, you need to use spaces.
(But DON'T use spaces all the way back to the left margin: use as many tabs as you need to get to the "normal" indent level for the current block, and use spaces from there.)
The nifty part is, this extra indentation that requires spaces is also the type of indentation that you put in manually, not the kind that the editor will (or can!) do for you. So if an editor was ever set up to work this way, it could be fairly simple -- e.g. in vim, it could be as simple as not setting expand-tabs when autoindenting, but when the user hits the tab key, turning it on for each tab key press. |