I came to the conclusion that tabs are better because they give more choice to each individual.
-Deozaan
The reason I use spaces is for exactly this reason. Consistency in code, as you can set the tab to be anything, and get unusual alignment when using tabs.
-wraith808
I'm not sure I follow you. How does using spaces give more choice to each individual? And how does it provide any more consistency in code than tabs do?
One tab-width indentation is always exactly as wide as you've configured it to appear to you. You can't get any more consistent than that.
But once you decide to use spaces, then you have to determine how many spaces to use per indentation block. Some people prefer 2 spaces. Some (most, I think) prefer 4. Some do weird things like 3 or 6 or even 8! And if you're working on a project with someone (or with a library written by someone else) who prefers a different amount of spaces than you, you no longer have consistency. One or both of you needs to compromise and submit to the others' spacing preference.
With tabs you can just use tabs, and configure your IDE to display it how you want it to appear to you. And others can configure how they want it to appear to them. Everybody wins. It's the most accessible and friendly way to get it to look how you want it to look and to allow others the same privilege, even if all parties disagree on what looks best to them.
In summary:
- Spaces are dictatorial in that they enforce your preference on others, whether they like it or not.
- Tabs allow each individual the freedom (and responsibility!) to configure it to appear in whichever way pleases them most.
That said, if VCS doesn't properly handle tabs (which hasn't been my experience) then that's not the fault of the tabs. It's the fault of the crappy version control software (or GUI client written for the VCS).
In practice, it doesn't really matter to me which I use. But I'm still of the opinion that tabs are The Better Way
TM since they allow the most freedom for everyone involved to view the code how it looks best to them.