Tabs versus spaces: Spaces won

Why? Because since at least Visual Studio 2005, the default for tabs/spaces has been:


Insert spaces, not “Keep tabs”. If tabs were supposed to win, they would have won the default settings battle. If the default settings in Visual Studio aren’t “do tabs everywhere”, then you’re fighting some serious momentum against you.

I used to have “Keep tabs” on as my default, but this proved to be quite, quite annoying when working with teams or OSS development. If I get a pull request with spaces, I might re-format the document to have spaces. But then it becomes much harder to understand what has changed, since I have to fight with how well the diff tools deal with whitespace changes.

Even worse is the developer that re-formats documents they only look at, but don’t make any semantical changes to. I’ll see a commit with 5 changed files, but only one has actually changed.

I hit this with a pull request in AutoMapper, where the person submitting the pull request decided to replace all spaces with tabs, making it pretty hard to understand what changed without special whitespace switches.

Do you like tabs in Visual Studio? I do too! But I gave up the tabs versus spaces argument, and so should you.

Spaces won.

Twtpoll – your git global core.autocrlf settings