Nobody talks about the real reason to use tabs over spaces
What most of these discussions leave out is that you can&#x27;t just say &quot;use spaces instead of tabs.&quot;<p>You have to say <i>how many</i> spaces.<p>Is it 2? 3? 4? 8? How many?<p>If you use spaces, you are committing to say how many will represent one indent. And please take note of how your choice affects the visually impaired programmers from the Reddit thread. Or someone like me who finds monospaced fonts hard to read and proportional fonts much more legible.<p>But why do you even need to say this? Why should it matter how many spaces represent an indent level?<p>The only time it really matters is when you not only use indentation, you use <i>column alignment</i>, like this:<p><pre><code>  myFunctionThatDoesStuff(someArgument,
                          andThisCalculatedOne(anArgumentThatMeansSomething,
                                               anotherWordyName));
</code></pre>
This style is mandated by many coding standards, including Google&#x27;s C++ standard. If you use an alignment-based style, you had better use spaces, or else you are in the &quot;tabs for indentation, spaces for alignment&quot; muddle.<p>What would happen if you abandon column alignment and use only indentation:<p><pre><code>  myFunctionThatDoesStuff(
      someArgument,
      andThisCalculatedOne(
          anArgumentThatMeansSomething,
          anotherWordyName
      )
  );
</code></pre>
Here the parentheses are treated just like curly braces: if you need to line stuff up, don&#x27;t do it at whatever column things happened to fall on, do it by indentation only. That&#x27;s how we code curly brace blocks.<p>Now your code will be just as readable if it&#x27;s indented with tabs, or with whatever number of spaces you like.<p>If we coded curly brace blocks the way these standards require us to use parenthesized expressions, our code would end up looking like this:<p><pre><code>  if(someBooleanExpression) {someFunctionCall();
                             if(anotherBooleanExpression) {doSomething();
                                                           doAnotherThing();}}
</code></pre>
Do you code like that? Do you <i>want</i> to code like that? Then why do you format code like that (if you do) simply because the delimiters happen to be parentheses instead of curly braces?<p>If you stop using column alignment, and start using indentation instead, so many problems go away. Space indentation (and how many spaces?) no longer has any advantage over tabs.<p>I sometimes wonder why so many coding standards mandate column alignment. I think it is because people get tired of talking about it and say &quot;we must agree on <i>something</i>, now! And we will stick with it forever.&quot;<p>I&#x27;ve been in these discussions, and what happens is whoever is most &quot;passionate&quot; about their particular style gets their way. And that will usually be the person who is fussiest about these things, the person who loves fiddly column alignment. Why else would such an impractical approach be baked into so many coding standards?