Alice, who prefers four-space indents, wants this:
Bob, who prefers eight-space indents, wants this:
Is it possible for this source code file to be written such that Alice and Bob each see what they want?
Yes, but not yet.
What they need to do is to use tabs only up to the level of indent of the first line, then spaces the rest of the way:
Note that the contents of the file are the same in both of these images; the only change is the indent width. The characters shown in these two images produce the result shown in the earlier two images.
I say “not yet” because no editor currently does this. Xcode, for example, will use on each line as many tabs as it can fit, followed by < tabstop spaces. Other editors won’t line up the colons; they’ll just left-justify all of the non-first lines.
So Alice and Bob can each have the indent width they want; it’s just a pain in the ass for them to do the editing necessary to get it. Therefore, they won’t bother, just as I don’t.
So, consider this my call to the makers of all the editors to auto-indent the right way, as I have just shown it.
Added a few minutes later: Alternatively stated by Christopher Bowns on his blog post.