Google developer Felipe Hoffa decided he wanted to get to find a winner of this debate. So he parsed 1 billion files among 14 different programming languages to find out which method is actually more popular and then published the results in a recent blog post on Medium.

Advertisement

The data Hoffa used was sourced from GitHub files stored in BigQuery. He made sure there were no duplicates or files with less than 10 lines of code. The developer also gave one vote per file (so if it used both tabs and space, the vote went to whichever was used more frequently). Finally, the top 400,000 repositories were sorted by the number of stars they received on GitHub between January 2016 and May 2016.

Advertisement
Advertisement

Here’s what he found:

Advertisement

As you can tell from the data, the overwhelming winner here is spaces. In every major programming language besides C, spaces were used in the most popular files on GitHub. This evidence is about as definitive as it will ever get in revealing whether tabs or spaces are more popular in code.

But why? Space People will tell you that this is a no-brainer because spaces display the same across all hardware, text viewing software, and they’re flat out more visible than stupid tabs. Of course, Tab People might have a much different opinion about that.

Advertisement

Are spaces qualitatively better than tabs for some reason? It remains unclear. If you have a strong opinion either way, though, please fight it out in the comments.