Wandering Thoughts archives

2006-07-06

More on tabs

The one thing that changing hard tabstops allows is for the same file to come out different for different people. This may explain its enduring popularity, because in theory you can use it to view source files in your favorite indentation level while letting me view them in mine. If you like two-space indents and I'm a mutant who likes 8-space ones, we can both be happy.

Of course this is only an illusion; it breaks down explosively any time you need sub-tab indentation (and any time you're using indentation to align with other text).

(Alas, this entire chain of logic is partly an illusion. I'm pretty sure that vi's tabstop setting predates any sort of support for soft tabs, and was created so that people who wanted to indent by four spaces could do so in the easiest way possible.)

I'll also take this opportunity to link to Jamie Zawinski's Tabs versus Spaces: An Eternal Holy War (from here), which has a lot of sense about the whole situation and a lot less ranting than I did yesterday.

The whole issue may sound like a tempest in a teapot, but I think it's important. People spend a lot of time reading source code, and we know that whitespace is important for readability in general. If we want readable code (and we should), we need to get the whitespace right enough; it's just that no one is entirely convinced about what 'right enough' is.

(And having written this I'm forced to wonder what the typesetting wonks might have to teach us on all of this, since whitespace issues do come up when typesetting ordinary books and so on.)

programming/OnTabsII written at 03:36:06;


Page tools: See As Normal.
Search:
Login: Password:

This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.