“Professional programmer” is a level of skill acquired through experience. Not really, because “no true Scotsman” assumes that the arguments are subjective. Though for the sake of my own salary, I’m sticking with spaces for now. In any case we’d be interested in hearing hypotheses about this relationship.
You can find the code behind this blog post here if you’d like to reproduce the analysis.
If you’re a data scientist, statistician, or analyst, I encourage you to download the raw survey data and examine it for yourself. As an exercise I tried controlling for many other confounding factors within the survey data beyond those mentioned here, but it was difficult to make the effect shrink and basically impossible to make it disappear.Ĭorrelation is not causation, and we can never be sure that we’ve controlled for all the confounding factors present in a dataset, or indeed that the confounders were measured in the survey at all. And it is impressively robust even when controlling for many confounding factors. So… this is certainly a surprising result, one that I didn’t expect to find when I started exploring the data. Put another way, using spaces instead of tabs is associated with as high a salary difference as an extra 2.4 years of experience. (By predicting the logarithm of the salary, we were able to estimate the % change each factor contributed to a salary rather than the dollar amount). The model estimated that using spaces instead of tabs is associated with an 8.6% higher salary (confidence interval (6%, 10.4%), p-value < 10^-10).
I did several other visual examinations of possible confounding factors (such as level of education or company size), and found basically the same results: spaces beat tabs within every group. Note that respondents could select multiple languages, so each of these groups are overlapping to some degree. (This gave a similar result even when filtering for developers only in a specific country, or for ones with a specific range of experience).
Yes, the effect existed within every subgroup of developers. The Developer Survey asked both about what programming languages each respondent uses (Python, Javascript, etc) and what “type” of developer they are ( web developer, embedded developer, etc).ĭid we see the same tabs/spaces gap within each of these groups? with DevOps developers more likely to use spaces and mobile developers more likely to use tabs), often because they use different editors and languages. The effect is smaller in Europe and especially large in India, but it does appear within each country, suggesting this isn’t the sole confounding factor.Īs another hypothesis, we know that different types of developers often use different indentation (e.g. We could examine this by considering whether the effect occurs within each country, for several of the countries that had the most survey respondents. For example, it’s conceivable that developers in low GDP-per-capita countries could be more likely to use tabs, and therefore such developers tend to have lower salaries on average. When I first discovered this effect, I assumed that it was confounded by a factor such as country or programming language.
This is an amusing result, but of course it’s not conclusive by itself. Developers who responded “Both” were generally indistinguishable from ones who answered “Tabs”: I’ll leave them out of many of the remaining analyses. (Note that all the results were converted into US dollars from each respondent’s currency). Indeed, the median developer who uses spaces had a salary of $59,140, while the median tabs developer had a salary of $43,750. Coders who use spaces for indentation make more money than ones who use tabs, even if they have the same amount of experience:
Of them, 12,426 also provided their salary.Īnalyzing the data leads us to an interesting conclusion. Within this group, 40.7% use tabs and 41.8% use spaces (with 17.5% using both).
There were 28,657 survey respondents who provided an answer to tabs versus spaces and who considered themselves a professional developer (as opposed to a student or former programmer). But today we’re releasing the raw data behind the Stack Overflow 2017 Developer Survey, and some analysis suggests this choice matters more than I expected. I use spaces, but I never thought it was particularly important.
This is a bit of a “holy war” among software developers one that’s been the subject of many debates and in-jokes. Do you use tabs or spaces for code indentation?