Spaces Versus Tabs Can Determine Developer Pay

For some software developers, the question of whether to use spaces or tabs for code indentation is a hotly contested one. There’s even an episode of the HBO comedy “Silicon Valley” in which a character destroys a budding romance by saying: “No way I’m going to be with someone who uses spaces over tabs.”

To those outside of the software industry, such a debate might seem trivial. But in programming, consistent formatting is all-important, especially since different editors and displays can present the same block of code in different ways. Code that’s a mess of tabs and spaces can lead to arguments and confusion among team members, slowing down projects.

“It doesn’t actually matter which coding styles you pick,” Jeff Atwood, co-founder of Stack Overflow, wrote in a notable blog posting way back in 2009. “What does matter is that you, and everyone else on your team, sticks with those conventions and uses them consistently.”

But according to some new data from Stack Overflow, what style you pick does have a notable impact on your salary. “Coders who use spaces for indentation make more money than ones who use tabs, even if they have the same amount of experience,” the company concluded in a blog post detailing the analysis.

Stack Overflow based that conclusion on the 12,426 respondents who answered a “tabs vs. spaces” question on its most recent developer survey, and who also provided salary data. Developers who relied on spaces had a median salary of $59,140, while those using tabs pulled down $43,750. Take a look at their graph:

That salary differential remained constant even when Stack Overflow’s analysts controlled for other factors: “It was difficult to make the effect shrink and basically impossible to make it disappear.”

As the blog posting points out, correlation is not necessarily causation. Nonetheless, the results—and Stack Overflow’s inability to eliminate confounding factors—is pretty fascinating. If you’re interested in exploring the mystery yourself, you can download the raw survey data (CSV).

7 Responses to “Spaces Versus Tabs Can Determine Developer Pay”

  1. Robert

    Could it be that spaces, being the ‘older’ style, simply has acolytes with greater career lengths, which generally equates to greater earnings? When I started coding in the 70’s, tabs were not allowed and would have aborted the compile. Spaces, on the other hand, were stripped by the pre-compile and therefor did nothing. So we all learned to indent with spaces, and that’s what we taught any new staff, year after year after year.

  2. Les Cardwell

    This is most likely correlation vs. causation. My guess is that the reason developers use spaces vs. tabs is that the complexity of the problems addressed and the skill-set of the developer requires deeper nesting of if/then (case, etc.) logic. With tabs, a developer can run off the screen if the nesting is too deep, making the code just that much more difficult to read and maintain. Today’s GUI allows for more breadth onscreen than did CUI, but it’s still an issue in deeply embedded use-cases. JM2c…

    • Robin Riley

      If a method is so deeply nested that tabs will potentially run the code off the screen, that says “code smell” to me. In which case I’d consider the need for refactoring to be a much bigger issue than spaces vs tabs.

  3. Todd Crump

    The title of this article did not specify the context (code editing), and I thought this would be about desktop/workflow, i.e. using multiple desktop spaces vs. window tabs. I didn’t take the survey and didn’t see how the question is worded, but perhaps some of the responders made the same mistake?