Salary analysis flares tabs versus spaces debate

Stack Overflow data scientist finds developers who use spaces earn more

The “eternal holy war” over tabs versus spaces is set to flare again following a report which suggests developers who use spaces for indentation make more money than those who use tabs, even if they have the same amount of experience.

Analysis by Stack Overflow data scientist David Robinson on the company’s annual developer survey led him to the “interesting conclusion” which stood up even when taking into account various compounding factors like country, formal education and size of employer.

“This is certainly a surprising result, one that I didn’t expect to find when I started exploring the data. And it is impressively robust even when controlling for many confounding factors,” he wrote in a blog post yesterday.

He added that even after testing numerous controls: “it was difficult to make the effect shrink and basically impossible to make it disappear”.

Of the 64,000 respondents to January’s Stack Overflow 2017 Developer Survey, more than 28,000 considered themselves a professional developer and provided an answer to tabs versus spaces.

Out of that group, 40.7 per cent use tabs and 41.8 per cent use spaces, with 17.5 per cent saying they used both.

Developers who used spaces had a median salary of US$59,140, while those using tabs earned US$43,750.

The correlation held when the groups were divided by country, as well as programming language used and type of developer (web developer, DevOps, mobile developer etc).

“Yes, the effect existed within every subgroup of developers,” Robinson said of his findings. “The model estimated that using spaces instead of tabs leads to an 8.6 per cent higher salary. Put another way, using spaces instead of tabs was worth as much as an extra 2.4 years of experience.”

The debate between tabs and spaces has raged for many years, inspiring endless memes and an entire episode of HBO show Silicon Valley.  

Last year Google developer Felipe Hoffa parsed a billion files from the top 400,000 GitHub repositories (amounting to 14 terabytes of code) to determine whether using tabs or spaces was more common. Spaces came out overwhelmingly on top across all the major languages, save for C and Google’s Go.

Join the newsletter!


Sign up to gain exclusive access to email subscriptions, event invitations, competitions, giveaways, and much more.

Membership is free, and your security and privacy remain protected. View our privacy policy before signing up.

Error: Please check your email address.

Tags codingsalarydata analysisdeveloperData scienceStack Overflowtabsspaceseternal holy warspace space space space

More about Google

Show Comments