Would be interesting to see a statistic on 2 spaces vs 4 spaces as well. Somehow, I can never get used to 2 spaces, the code feels too cluttered. This applies to json/html/xml as well.
I imagine a lot of the stats are based on tooling defaults. For Java we have a corporate standard to use tabs but most developers aren't even aware of their indents. Eclipse defaults to spaces so thats what ends up in a lot of code.
I've found that a lot of developers I talk to prefer tabs (for indenting only) but go with spaces when they start a new project because they feel like it's less contentious for some reason.
Interesting how Ruby has almost no code indented with tabs, while Go has almost no code indented with spaces (I believe this is due to gofmt, but I might be wrong).
Yep, it's due to gofmt, which enforces tabs for all semantic indentation and spaces for all alignment indentation (which means lines never start with a space).
Actually, I think that mixing the two (alignment is for spaces, indentation is for tabs) fixes all of the problems faced by both camps. It makes the tab width configurable, without ruining any visual alignment you've done.
That is what I use, tab for indentation (left-most chars of the line), space for alignment.
This what, regardless the editor, the indentation is always correct and the alignment all the same, the code simply slides left or right depending on the tab-size of the editor.