I'm somewhat ambivalent about it though. On the one hand I find it easier to read (less scanning back and forth across the page) but on the other it is forgiving to deeply nested code.
Really: I couldn't care less about how much spaces my team mate is using for a tab. I just know: Indent by tab, and everyone can set their settings on their own and it looks always perfectly indented.
tl;dr; Spaces are the correct technical choice due to interop issues with TAB.
I'm personally in the camp that feels that spaces are logically inferior; A tab uses one character to represent some atomic idea that you intend to declare (an indent level). Replicating this intent with sequences of repeated spaces is on par with centering text on a web page by using
Hello World!
instead of setting the text-align CSS style. (Just as that method prevents the browser from centering the text correctly according to the user's chosen viewport size, so using spaces for indentation prevents an editor from letting a user read code the way they would prefer to.)Of course, if the project/platform you're working in has an established style guide or convention in place, go with that :)
At one time there was a movement afoot for some sort flexible tabbing (using actual tabs) but it seems to have died out.
It's 3 space tabbing or go home.
(I am actually serious, about the space part, not the clue part. 2 spaces looks like a typo and 4 wastes space once you indent a couple of times. Got to be 3, although if I had to choose, 2 or 4, then definitely 4.)
larger spacing discourages pyramid code (like in python which is stylistically functional), but sometimes (eg: HTML) this is unavoidable, and 4 spaces are a nightmare
On a very different note: why is it that the default "tab" in so many of these online editors is just two spaces? It seems to be a thing in many online code based editors, and I don't know why. Is that a common convention for the languages that the authors of these in-browser-editors use? What's the deal? And why can't I change it to four spaces?