Developers Who Use Spaces Make More Money Than Those Who Use Tabs

Do you use tabs or spaces for code indentation?

This is a bit of a “holy war” among software developers; one that’s been the subject of many debates and in-jokes. I use spaces, but I never thought it was particularly important. 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.

Spaces make more money than tabs

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). Within this group, 40.7% use tabs and 41.8% use spaces (with 17.5% using both). Of them, 12,426 also provided their salary.

Analyzing the data leads us to an interesting conclusion. Coders who use spaces for indentation make more money than ones who use tabs, even if they have the same amount of experience:

Indeed, the median developer who uses spaces had a salary of $59,140, while the median tabs developer had a salary of $43,750. (Note that all the results were converted into US dollars from each respondent’s currency). Developers who responded “Both” were generally indistinguishable from ones who answered “Tabs”: I’ll leave them out of many of the remaining analyses.

This is an amusing result, but of course it’s not conclusive by itself. When I first discovered this effect, I assumed that it was confounded by a factor such as country or programming language. 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.

We could examine this by considering whether the effect occurs within each country, for several of the countries that had the most survey respondents.

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.

As another hypothesis, we know that different types of developers often use different indentation (e.g. 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 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).

Did we see the same tabs/spaces gap within each of these groups?

Yes, the effect existed within every subgroup of developers. (This gave a similar result even when filtering for developers only in a specific country, or for ones with a specific range of experience). Note that respondents could select multiple languages, so each of these groups are overlapping to some degree.

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. Now that the raw data is available, I encourage other statisticians to check other confounders themselves.

Estimating the effect

If we control for all of the factors that we suspect could affect salary, how much effect does the choice of tabs/spaces have?

To answer this, I fit a linear regression, predicting salary based on the following factors.

  • Tabs vs spaces
  • Country
  • Years of programming experience
  • Developer type and language (for the 49 responses with at least 200 “yes” answers)
  • Level of formal education (e.g. bachelor’s, master’s, doctorate)
  • Whether they contribute to open source
  • Whether they program as a hobby
  • Company size

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). (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). Put another way, using spaces instead of tabs is associated with as high a salary difference as an extra 2.4 years of experience.

Conclusion

So… 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. 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.

Correlation 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. If you’re a data scientist, statistician, or analyst, I encourage you to download the raw survey data and examine it for yourself. You can find the code behind this blog post here if you’d like to reproduce the analysis. In any case we’d be interested in hearing hypotheses about this relationship.

Though for the sake of my own salary, I’m sticking with spaces for now.

Author

David Robinson
Data Scientist

Related Articles

Comments

  • Keith Hultman

    That is quite an interesting result. The fact that it is found in every language is impressive. As a tab user, I don’t think switching to spaces will have an effect on my salary or job prospects as I think the confounding variable here is probably coder personality and attention to detail. Did you look at age?

    • Pasquale

      “I think the confounding variable here is probably coder personality and attention to detail.”

      ^^^ This.

      And also: experience with source control and collaboration.

      • Interestingly, the author claims that experience is considered to be a confounding variable. Can you gain experience, yet, as a lone programmer? Perhaps, so this is a great point about collaboration. It’s usually when you collaborate you find out that your tab-settings are incompatible with other people’s settings, because they either use spaces, or a different indentation settings for tabs.

      • As another hypothesis, we know that different types of developers often use different indentation (e.g. with DevOps developers more likely to use spaces and mobile developers more likely to use tabs), often because they use different editors and languages.

      • So… 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. 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.

    • Draco18s

      I’ve certainly never been asked if I use tabs or spaces during an interview. Or after I was hired. Or really in any context other than the online holy war…

    • I think it’s more likely that spaces are just more prevalent in a certain type of commercial environment that also happens to pay higher salaries.

  • Eric Hydrick

    Did you look at number of languages space vs. tab users know and/or use? I’d imagine being a polygot would command a higher salary, and it’s possible space users tend to know more programming languages than tab users.

  • Vidhyashankar Madheswaraswamy

    I guess we need to look the other way. Developers who earn more ( are obviously Good at what they Do), Prefer spaces than Tabs. This can be inferred that better programmers prefer spaces.

    • > Developers who earn more (are obviously Good at what they Do).

      This is a very poor deduction.

    • Nick Odaemus

      You *can* infer that, but it’s foolish. There are so many personality factors behind those two statistics! Developers who earn more ≠ better programmers; they may earn more
      based on their assertiveness with raises and beginning salary alone, which has nothing to do with their programming quality.

  • Václav Haisman

    Spaces master race!

    • We can do without the Nazi references thank you,

      • It’s actually a Zero Punctuation reference, interestingly enough.

        • CeeBee

          Which was a reference to . . .

      • Václav Haisman

        lol, it is not a Nazi reference. Know your meme.

  • Chris

    Isn’t it more likely that older developers who are locked in their ways use spaces, and since they are older they are more experienced since they have been developing longer and thus make more money in general. Like in decades past you could probably say people who smoke make more money.

    • Izkata

      No. The very first chart is about years of experience.

      • CeeBee

        Years of experience; Not age.

    • Victor Lewis

      Check the x axis

    • Read the article – not the headline 🙂

    • Read the article. The very first graph plots age, and it starts out with spaces over tabs, and continues. Nothing to do with older age. Plus, a modern PHP developer who has adopted the PSR coding standards isn’t “locked in their ways”; it’s a prevalent coding standards that’s become widely-adopted.

  • Lundin

    All professionals know that you cannot write source code that contains tab symbols, because such
    code will always turn into an unreadable mess whenever exported (for example when posted on SO). Therefore all professionals tend to know that you configure your text editor to insert spaces upon tab, which tends to be the default setting in almost every IDE out there. Then you can indent by pressing the spacebar or by pressing the tab key and it doesn’t matter. Assuming you know these things, the question “tabs or spaces” doesn’t even make any sense.

    • Jit

      unless you also configure your IDE to magically delete 4 spaces on pressing backspace after an IDE inserted 4 space block, there’s serious chances of messing up the formatting of your code. This risk goes even bigger if you have junior devs working on the codebase.

      • Lundin

        How? Most editors don’t delete 4 spaces but 1 when you press backspace. You will have to be pretty damn oblivious to your own source code if you don’t notice that the marker isn’t where you want it to be. Really, this whole “tab vs spaces” is a non-issue that doesn’t exist. All professional source code out there that uses space tokens, because insert-space-upon-tab is industry standard. I have no idea why I am the only one raising this question… nobody else used a source code editor before?

        • Mike

          I’m with you on tab’s converting to spaces 😀

          Jetbrains IDE’s delete 1 space upon backspace, and depending on coding style, will insert 2 or 4 spaces upon tab.

          You can then remove the indents by using shift+tab.

          After selecting multiple lines you can indent / unindent as much as you like with tab. pressing space just deletes the block of code.

          Maybe these anti-tab people are still using vi / notepad that keeps tabs as tabs?

          • The “anti-tab” people do the same thing as you (e.g., I use vim and it also can insert spaces on tab, just like most IDEs can insert “soft tabs”). We frequently press the tab key just like normal people, we just want that to map to spaces, not tabs. On the other hand, the pro-tab people use actual tabs, that is the 0x09 character, in their code.

          • Mike

            Ah okay thanks. I prefer spaces, and will generally swap any tabs I find over to spaces.

            I think there is some crossover in the discussion on this page about use of Tab key vs actual tabs in code. In general it seems fine to use the tab key, providing it maps to spaces.

        • klmr

          What terrible editor is this?! Most/all editors I’ve encountered are configurable to have backspace undo one level of tab indentation, even when tabs are converted to spaces.

          The last time I can remember an editor didn’t do this was ~ a decade ago.

        • Edwin Kravčenka

          Sublime deletes all tab spaces together by default when u have tab translation into spaces. Also *all* good editors can programmed to do nearly anything you want.
          Pretty sure Vim also deletes tab spaces.

      • Mike

        shift+tab will undo the spaces inserted with tab.

        Also, don’t most IDE’s have an option to auto format code?

    • Bryan Oakley

      This sounds like a “No true Scotsman!” argument.

      • Lundin

        Not really, because “no true Scotsman” assumes that the arguments are subjective. “Professional programmer” is a level of skill acquired through experience. Everyone who is experienced have exported code and viewed it in a different editor. This is not subjective – of course every programmer will eventually end up using different editors. Upon doing so, anyone with eyes will notice that code indented with tabs turns into a horrible mess. This is not subjective, it is a simple fact, since different editors have different tab settings. Upon noticing this, people who indent by using the tab key eventually starts configuring their editors to insert spaces. Programmers who have interacted with other programmers will know from experience that this is a phase that most programmers go through as part of learning. This leaves us with 3 categories: inexperienced programmers who indent with tab key to insert tab symbols, experienced programmers who indent with tab key to insert spaces, and programmers (no matter level of experience) who indent with spacebar to insert spaces.

        • Jimmy Jim

          All professionals know that simply having different tab settings doesn’t turn code into a horrible mess. Tab settings usually just change the spacing of each indention level. Exactly the same effect they have when converting tabs to spaces.

    • Kyle Strand

      I know multiple experienced, professional coders who know all of the above and nevertheless prefer tabs.

      Heck, I believe Linus mandates tabs in the Linux kernel.

      I disagree with the preference for tabs, but that doesn’t mean it’s only endorsed by the ignorant or inexperienced.

  • sqd

    I was expecting that people who use both make much less money…

  • Izkata

    As someone who started with tabs and quickly switched to spaces ~15 years ago, I think it’s something much more trivial that’s often frowned upon when source control is involved, but that makes certain parts of code far more readable: Using spaces to align similar statements. It’s much harder to do consistently when tabs are involved. I can easily see that extra readability leading to a jump in productivity, though I wouldn’t expect that much.

    • POOL-POG

      this. however, this is the core argument in the “tab v space” holy war, and as such, it won’t convince anyone.

      space argument: this

      tab argument: this is irrelevant, your IDE/text editor can translate these alignment issues transparently. This isn’t 1995 anymore.

      I’m in the “spaces” camp, btw

      • Pluckerpluck

        > your IDE/text editor can translate these alignment issues transparently.

        Spaces always require you to use multiple arrow key presses to move through them. Tabs are a single key press. This isn’t important if you are a vim god I guess though.

        Or when doing work collaboratively, the last thing you want to be doing is changing the indentation size of spaces (causes chaos with alignment cases), yet tabs let you do this visually without affecting anything else.

        Just pointing out that the translation is not quite transparent. There are still differences.

        • CeeBee

          ctrl/cmd+arrow makes short work of travelling through any indentation or even white space, regardless of type (though I personally find Mac deals with this in a terrible fashion).

          • Izkata

            And vim uses w (for “word”) and b (for “back”) to do the same – jump a text word and its trailing whitespace at the same time in a single keystroke.

        • POOL-POG

          this is why i always use spaces

      • Izkata

        I’m not talking about the beginning of the line, though. I’m talking about in the middle of the lines. For example, aligning assignments or dictionaries into columns, or a related-but-not-abstractable series of function calls or math statements, to make it far easier to just scan down.

        If people could easily stick to Pluckerpluck’s tabs-for-indentation/spaces-for-alignment way of doing it there wouldn’t be much of an issue. But inevitably, tab-users will use tabs to do those alignments, and that’s when it quickly gets all out of whack.

        • POOL-POG

          well… idk about “IDEs” but vim can handle this use case

          still, spaces are the only real way to code

        • CeeBee

          I’ve been arguing for Tabs for Indentation, Spaces for Alignment for years, but.. too many people see it as an all-or-nothing approach, probably since not thinking about it means they can concentrate on other details.. or their 3D printer breaking again.

    • Pluckerpluck

      I prefer tabs for a variety of reasons, but there is ONE aspect I dislike which is aligning statements. Normally I would just say that you should use tabs for indentation, spaces for alignment. The problem is that people suck though and screw this up ALL THE TIME. If people just used tabs for indentations and spaces for alignment it would all work, but alas, that’s not the world we live in.

      My solution is to newline the stuff I want to align. Took a while to get used to, but I think it’s optimum:


      if (longComplexThing && otherComplexThing && finalComplexThing) {

      becomes


      if (
      longComplexThing &&
      otherComplexThing &&
      finalComplexThing) {

      Lets me use the glorious tabs but still ensure code compatibility with all the crazy people who can’t follow a set of coding guidelines.

    • CeeBee

      I learned long ago you wouldn’t want to align with tabs, but that doesn’t mean you can’t use tabs for indentation. I suppose in the end making such a distinction is too painful when your IDE doesn’t do it and you can just hammer tab a few times to align instead.

      • Bryan Oakley

        If you use tabs for indentation and spaces for alignment, how do you handle the case where different tab widths break the alignment?

        • CeeBee

          They don’t. When would you align things on different indentation levels? That’s insanity regardless of if you use tabs or spaces. Using Pluckerpluck’s example below: under TISA that would be spaces, not tabs.

  • Sik

    I’d imagine the real predominant factor here is what kind of coding styles prevail where each of those programmers work (since I’d imagine that eventually this would influence what said programmers get accustomed to using, and hence “skewing” the results here). That would also probably show up some other patterns in common rather than spaces vs tabs.

    • This seems like a good hypothesis. To pick on marketing firms and programmers who work for them, I would have to guess these are the low bar jobs from my experience in working in many different organizations in terms of rigor. The enforcement of structure is much more relaxed and code reviews are practically unheard of compared with a software shops that typically pay more. Code shops tend to use spaces over tabs as it tends to work better in command line editors such as vim and then look good on github as well. Try having tabs on github. It sucks.

      • Brian Christensen

        .editorconfig in your repository root specifying your preferred indent_size for display on GitHub easily solves that.

    • CeeBee

      Thanks for actually paying attention 🙂

  • zer0 0ne

    Tabs are for word processors not IDEs

  • GrandOpener

    Are median salaries in Germany and UK really *half* what they are in the US? Maybe this is something I should already know, but that was the most surprising revelation here to me.

    • Thomas Peeters

      Perhaps related to the differences in income taxation?

    • No, Americans are more likely to lie about how much they earn. Cela explique tout.

      Surveys are notorious for having people answer what they think should be the right answer.

      That means that a bunch of responses will be conditioned on the fact that Richard from ‘Silicon valley’ uses one or the other (I forget which – I’m a Guilfoyle… I do things that matter, so I have no time for trivial nonsense… he said, typing a comment on the internet – in my own defense, it’s 12:30 a.m. here and I am having a glass of wine having almost finished a project report that was due a week ago).

      People with nothing better to do need false dichotomies so that they can pick a side and belong. It’s been that way since the Blues vs Greens in Byzantium, and probably before. Anyone who wants to belong to either side of a pointless dichotomy needs to die in a fire.

      • klmr

        Hm. Gross salaries for developers in the US are vastly higher than in Germany and the UK. Maybe not 2× but from the numbers on starting salaries (!) that I’ve seen, 2× actually isn’t terribly far off.

        Lying about salary might be another factor but it’s minor compared to the actual, real salary difference. Of course this also differs within the US (Bay area …) but even the mean is higher.

      • Brian

        Americans are more likely to lie.. as you sip on kool-aid calling it wine. Irony…

  • commenter

    Maybe the space users have more of a ‘i don’t care if it is theoretically correct, it works’ attitude and therefore more of them have a job in a larger company which pays better?

    • Spacer

      You’re probably a tabber!

      • commenter

        I doubt that you are one 😉

  • Marlon Stevenson

    Maybe people who use spaces are more likely to overreport their earnings, because they also overcompensate on the lack of control in their lives by repeatedly mashing the spacebar.

    • Do you actually think people who use spaces for indentation press the spacebar for every level indentation that they want? Because that’s not the case, you just configure your editor to use spaces for indentation, to convert tabs to spaces. So when I hit Cmd+] or Tab, it inserts or removes 4 spaces. When I go to a newline it inserts the relevant number of spaces.

      • Juank

        then what’s the point of using spaces if you are already pressing the tab key?

        • PEP-8.

          • Sven Slootweg

            Worth noting that PEP-8 was never meant to be used for anything outside the Python standard library. There’s no reason to adhere to it in your own code, and there’s no technical rationale behind [many of] its recommendations.

          • Being consistent with every other Python project is a good enough reason for me. The tooling around it makes compliance very easy.

          • Bryan Oakley

            While I absolutely hate using whitespace rather than curly braces to denote a block of code, it is far, far outweighed by the fact that most python code looks the same since we mostly all share the same set of guidelines.

        • chugly

          1 – You can align text with finer granularity. For instance if I place a line break in a comma delimited list, the editor can align the list vertically with the resolution of a single whitespace, not 2, 4 or 8

          2 – The code looks the same no matter what the local tab size setting is

          • CeeBee

            That makes no sense. Tabs are only meant for indentation; You would use spaces either way for alignment. Tabs for Indentation, Spaces for Alignment.

        • Bryan Oakley

          the point of using spaces is so that the next person who looks at your code sees it the way you intended it to be seen.

      • Bryan Oakley

        I’ve seen one programmer in this discussion who claims that do that. I can’t imagine why.

      • Marlon Stevenson

        Maybe people who use spaces are not developed enough to understand humor.

    • Spacer

      Tabber!!!

  • wurtel

    Perhaps programmers using spaces lie more about their salary.

    • Félix Gagnon-Grenier

      Found the old school tab user 😉

      • CeeBee

        The trend is the opposite. I find it amusing when people say “Who
        still uses tabs?” — Tabs are more flexible and a *proper* understanding
        of them (and TISA) is only starting to emerge.

        • Félix Gagnon-Grenier

          I have yet to find a single “more flexible” thing one can do with tabs that I can’t do with any code reformatting tool…

          • CeeBee

            Not having to commit it. The moment you bring up a code reformatting tool, it doesn’t matter which side you’re on as the whole debate becomes moot: You pick one, and the one wielding the reformatting tool makes it happen. Period.

          • Félix Gagnon-Grenier

            Ahhh…! I believe I just now understood. I never considered the firm “without code reformatting” situation, thus was always confused with all this mess.

            Like… just hit two keys, and your code looks like you want. Indeed, without that, I would have to rethink about this.

            ta!

          • CeeBee

            Indeed, I think this whole mess revolves around not using reformatting tools and not understanding that TISA is an option… but whatever.

      • wurtel

        Certainly 🙂 I know I should be making more money 🙂
        Actually I only use vim for programming, none of this newfangled IDE stuff for me. In vim it’s trivial to :set expandtab which will accept tab as input but replace it with the appropriate amount of spaces. Combined with :set smarttab you don’t notice the difference with real tabs (besides that your source is larger, which in the early days was actually a concern…).

        • Mario Rivera

          You can use vim editing inside a lot of IDEs nowadays. Best of both worlds? Give it a shot. Newfangled things sometimes are good.

  • Max Savin

    Perhaps programmers who use spaces also participate in satanic rituals

  • I prefer spaces, but naturally one must adapt to the the coding style used in the project, so I am fine (begrudgingly) with tabs, but what really grinds my gears is when both are mixed – this causes such a horrendous mess…

  • Rolnard

    My IDE always offers to convert spaces to tabs… thus CRUELLY KEEPING MY SALARY DEPRESSED!

  • Michael Beskin

    gofmt uses 8-char width tabs for indentation. Are the Golang devs making ~$20k more with spaces not using gofmt?

    • gofmt uses tabs, your editor makes them 8-char width 🙂

      • Michael Beskin

        gofmt even standardizes the width

        . . . of course you are free to change it in your editor to be whatever you want.

        • CeeBee

          Oh, interesting — it even understands TISA. That’s great!

  • The very recent video “The Post JavaScript Apocolypse” on youtube features Douglas Crockford who says “If you can use one and do without the other, discard the other.”. We cannot do without spaces but we can do without tabs. This clear reasoning removes ambiguity and is a good practice to use this thought in code for all types of things that cause arguments but are not important. Its possible the slight nudge in one direction or the other may correlate with the small % of people that actually think this way where as it may only be a preference in the vast majority of cases as it is in mine.

    • Sven Slootweg

      I’m sure it’s a nice-sounding aphorism, but from a language design standpoint that makes *no sense*. With the same reasoning you could eliminate lots of operators and formats from languages, making the remaining operators have more (ambiguous, context-dependent) meanings. This is obviously not a desirable thing.

      It’s no different with spaces vs. tabs — they have different semantic meaning, for different purposes. *Could* you use one to replace the other? Sure, but you’d lose the unambiguous semantic meaning, which is a bad thing.

      • This is not a good example of “unimportant”. We would all do assembly language then by your reasoning.

        • Sven Slootweg

          What are you talking about? This has absolutely nothing to do with “using low-level languages” (which I presume is what you’re referring to), it has to do with unambiguous language design. “Assembly language” doesn’t come into it.

          I feel like you’re trying to have an entirely different discussion, totally unrelated to the point I’m making.

          • Contextually, Crockford was arguing about coding style, not about language design, specifically when it comes to tradeoffs of equal functionality that your team decides as a coding style. In that light, my assembly reference does relate to you taking an argument too far, for example if you said, we might as well only use assembly if we must reduce things to their basic functionality but instead, you used “language design” which is equally too far out of scope.

          • Sven Slootweg

            An analogy is not an argument, it’s an illustration. At no point did you actually argue how my argument was being taking “too far”, and you still haven’t done that. If you disagree with my argument, fine, but then *address the argument on its own merits*, don’t just throw in a poor analogy.

          • Try a sentiment analysis on your post history. You will find it enlightening.

          • Sven Slootweg

            And now you’re attacking me personally, instead of addressing my argument. If you don’t have a counterargument, then it’s fine to just refrain from responding, you know.

          • There’s no argument in the first place which was the point. It was about context which limits scope. However your sentiment averages toward negative which is unbiased if you use an AI. You are able to change that upward if you want to.

          • I’m seeing a pattern here in your responses. You are always correct from your perspective coupled with negative sentiment. Hope that works out for you.

    • Bryan

      You may have just converted me.

    • commenter

      Well we use tabs for something different than spaces, when we use it for indentation. By your argument we would all code with 3 symbols as those are the fewest symbols we would need to program.

      • Taken out of context. Douglas was referring to unimportant arguments about code style. If you take it in that context, your argument seems reaching.

  • Rolnard

    Maybe being extravagant in your use of bytes reflects an attitude of plenty that becomes a self-fulfilling prophecy in life.

    • Félix Gagnon-Grenier

      oh, so that’s what closing the line break html tag was all about…

    • CeeBee

      The attitude of plenty is rampant these days.

      • Indeed, the median developer who uses spaces had a salary of $59,140, while the median tabs developer had a salary of $43,750. (Note that all the results were converted into US dollars from each respondent’s currency). Developers who responded “Both” were generally indistinguishable from ones who answered “Tabs”: I’ll leave them out of many of the remaining analyses.

  • I’m a 10x spaces engineer. Your codebase is going to have so many more spaces in it when I’m done with it. Certified spaces growth hacker.

  • acommenter

    I think it’s funny that tabs people in the comments are saying “well it’s probably some other variable!”. The other confounding variables are exactly the point. No one actually believes that switching from tabs to spaces will gain you a nice raise. It’s the type of personality (or habits, or whatever) that lends itself to spaces that is more rewarded.

    • chugly

      That is exactly what I suspect

  • Petar Donchev

    Some languages have universal convention for one or the other – for example Python for spaces and Go code for tabs. So Python programmers definitely earn more than Go programmers?

    • but go you just use fmt…. who cares what you write go will fix it

    • Except the last graph shows that for both Python and Go developers, spacers earn about 33% more than tabbers.

  • carrie

    I find this to be both hilarious and insightful. Thanks for sharing.

  • Benjamin H

    Yeah, developers who use space over tabs probably do make more money. Because developers who use tabs get the job done faster, and as such, work less hours!

    They are ‘Whitespaces’, a useless character in most languages, and yet you waste eight key strokes on them, when you can do the same with one!

    • Sven Slootweg

      Almost every modern editor supports soft-tabs; that is, by hitting the TAB key, you insert N space characters. “Eight keystrokes” is not realistic.

      • Benjamin H

        Perhaps not eight, but unless N is equal to one, my point still stands.

        • N is equal to one

          • Benjamin H

            Ya, misunderstood!

          • klmr

            No: Sublime Text can obviously insert spaces when you press tab: https://www.sublimetext.com/docs/2/indentation.html

          • Thomas

            Do you honestly think people actually hit the space multiple times? Dude.. Everyone just changes the TAB output to X spaces.

          • Yeah I misunderstood

        • Thomas

          No, it really doesn’t.

        • Sven Slootweg

          N *is* equal to one when using soft-tabs. That’s the whole point…

        • chugly

          I press TAB once, the editor inserts ‘N’ spaces with N being the number of spaces needed to make the result visually the same as a hard tab. Try to grasp this concept, apparently it will make you earn more money if you do.

    • Giorgio Polvara

      This is the problem with that “Silicon Valley” episode. Nobody is hitting the spacebar eight times, people just use tab but render it as spaces

      • ive worked with developers who use space manually… it … is horrible

        • Giorgio Polvara

          I don’t see why anyone would do that

          • CeeBee

            Neither did I until I saw Tyler’s answer above. I didn’t imagine anyone would have to sub-condition themselves to handle the situation…

    • Tyler Hibbard

      People indenting by 8 characters instead of 4 are the real problem here, let’s be honest.

    • Mike Barlow

      Try saying “Whitespaces” is a “useless character” when coding in Whitespace – https://en.wikipedia.org/wiki/Whitespace_(programming_language)

      • Bryan Oakley

        or python.

    • Bryan Oakley

      Nobody wastes eight keystrokes for indentation. Us space users use the tab key just like you guys. Every decent code editor will do the right thing and insert the appropriate amount of spaces and/or tabs.

  • Victoria

    How are those using linebreaks :)?

  • xjlin0

    I’d love to see some error bars on your bar graph. 🙂

    • Ryan Thompson

      With 12,000 respondents, the error bars are likely too small to be visible on this scale.

  • Edwin Ramirez

    I’ve always been confused about something: What happens when I set my editor to output tabs as spaces?
    I’ve been using Sublime for years, recently jumped to Atom and VS Code; but in all I always configure my tabs to be 2 spaces.
    On what side am I? I prefer spaces for indentation. It’s more readable, less “empty space” on my screen. But I’m not a fan of smashing my space bar 2 – 6 times for each line.

    • Thomas

      You’re basically using spaces. If I change the keyboard letter A to output Z it doesn’t mean I’m using A.

    • Alfonso Pérez

      That’s spaces, I don’t think a lot of people do what you say ‘smash the keyboard repeated times’

    • Inquisitor

      I think everyone does exactly that. I don’t know anyone that puts spaces in manually.

    • Tyler Hibbard

      The only logical answer is that you are in the tabs group, because you are pressing the tab key to indent. Perhaps the survey’s next iteration should specify to respondents that “spaces” means “pressing the spacebar X number of times”, and we’ll see if this correlation stands.

      • klmr

        I’m pretty sure no professional programmer presses “space” repeatedly. The survey was asking after the textual representation, not the key you’re pressing.

        • Tyler Hibbard

          Hi, professional programmer here. Who presses space repeatedly.

          • Félix Gagnon-Grenier

            You may want to revisit that 😉

      • Bryan Oakley

        “The only logical answer is that you are in the tabs group” – I completely disagree. The debate isn’t about what key you press to do indentation, it’s about what characters are in your source code.

        • Félix Gagnon-Grenier

          finally… the only thing more baffling than tab users thinking space users mash the space key repeatedly, is tab users thinking tab is actually about the tab key, and not the tab character.

    • Bryan Oakley

      If your source code has tabs in it, you’re a “tabs user”. If you use the tab _key_ but have spaces in your source code, you are a “space user”.

      The debate isn’t about which key you press to do indentation, it’s about what characters are actually in your source code.

  • always use spaces

  • caitlynmayers

    I’ve configured my IDE to allow the tab key to use spaces. Prefer tab key for efficiency, but understand the spaces necessity. Does this data account for the ability to use the tab key to execute spaces? How would you categorize this group?

    We got into a heavy debate about this at work, to the point where I made team tabs and spaces shirts. Tabs has been printed twice, Spaces none, if that’s any indication.

    https://cottonbureau.com/products/team-tabs
    https://cottonbureau.com/products/team-spaces

    • Jan

      I imagine most developers in the “spaces” camp do this. I know nobody who favours hitting the space bar multiple times over hitting tab once. But this would certainly be an interesting hypothesis!

      • Tyler Hibbard

        I am a dev who actually hits the spacebar 4 times (if my IDE doesn’t automatically indent for me when I hit enter to go to a new line). I avoid using tabs because it’s not much of a time saver and specifically because we are conditioned to expect “tab” to be “move to the next UI button/element/file” in any other computer context. I’d rather not have to hammer a sub-condition into my mind for “different tab behavior but only in this one IDE”.

        • Bryan Oakley

          Why? Every modern IDE can be configured for the tab key to enter the proper number of spaces. I can’t imagine having (or choosing…) to type four spaces every time I wanted to indent something. Dude, get a better editor!

          • CeeBee

            His point is (if I understand correctly) that way the behaviour will be consistent even if, for whatever reason, he has to use an editor that doesn’t understand this — or even, I suppose, if you’re typing code in a text box on a web page where tab instead causes the focus to go to the next field..

        • Tim!

          Except word processing and document layout, where we expect tab to be “move to the next tab stop/indentation level”. The tab=”indent” convention is both older and more widely known than tab=”next control”.

  • DeeSnood

    I’m a tabs person, mostly because it’s simply the right choice. Firstly, the file size will be smaller. That has to be the preferred choice. Who would choose to have their files be larger? Secondly, it gives you total flexibility in terms of choosing how big a tab is in your editor. If you’re weird and prefer a tab to indent by 8, then that’s your choice. Those who have incredibly nested logic can use 1 or 2 characters. Personally I always choose 4. The thing is, you choose how you want to see it. If the file is using spaces, you don’t get any choice. The indentation will look the same always. If you want to ensure that people always see it the same, you simply specify in your coding standards that people should always set their indentation level in their editor to 4. I’d love to hear any real advantages to using spaces, other than the salary increase 😉

    • Tyler Hibbard

      “I’d love to hear any real advantages to using spaces other than the advantage this entire blog post is about” 😉 Also good look specifying *your* coding standards to dictate that *other people* change their own settings to match your preference.

      • jyounker

        The advantage of a tab is that it allows you to choose your visible indent size. However, varying indent size makes it functionally impossible to enforce column width. Therefore if you have a coding standard with a fixed width, spaces are the appropriate choice for justification.

        • CeeBee

          Why would you need to enforce a column width though? Alignment after indentation? If that’s the case then I guess the real reason there’s such a war over this is people don’t understand TISA.

          • jyounker

            By column width, I meant the total document width. (I didn’t write clearly, sorry). If a document has a 100 column max width, and one person uses two space tabs, and another uses four space tabs, and another uses eight, and they all use a 100 character width, then when one person views the work done by another, then the formatting will look wrong.

            The 8-char equivalent indent will look short on the 2-char equivalent user’s screen, having randomly short line lengths. The 2-char equivalent user’s code will overflow the 100 line length limit on the 8-person view. Alignments (say, for simple ascii images) are going to be off too.

            It’s going to lead to a code base that just looks wrong and messy.

            I don’t think tab/spaces matters for your own code, but if you’re in an environment where many people edit the same code, then using spaces with a fixed indent makes it easier to keep the code clean looking.

          • CeeBee

            What you’re saying doesn’t really make sense to me unless you’re talking about in-line alignment; Tabs (actual tabs) are only for indentation, so the width of a tab doesn’t matter. You wouldn’t align the insides (and technically leading spacing, after indentation) of ASCII art with tabs.
            It wouldn’t “look wrong” anywhere. Now, yes, you can exceed a column limit but unless you set it to something insane line 10 or 20 that’s hardly an issue (unless you’re the type of person to be totally inflexible about that column limit, which will give you other issues anyway).

      • Mike Barlow

        ummm it’s real easy to “dictate” that *other people* change their own settings to match your preference. It’s called using a static code analysis in your build process (I have our lint checker to check and error out if spaces are used in any code).
        You want to use spaces in your code? Great, but your code won’t pass the build queue if you do *wink*

        • Tyler Hibbard

          This assumes that you’re the person in charge of setting and enforcing coding standards for your group, and also that you’re only talking about code environments where code is shared within a small group, which are two pretty big assumptions. It’s also a pretty douche thing to do if you block spaced code.

          • Mike Barlow

            Well wouldn’t it also be a pretty douche thing to do to block tabs? And aren’t coding standards supposed to enforce a consistent style (see: https://www.smashingmagazine.com/2012/10/why-coding-style-matters/)?

            I prefer tabs (that’s just my world, but I can work with spaces if needed). But what happens when I’m walking through someone else’s code and they use spaces, but for some reason didn’t always use a 4 space indent. Their code could look messy and take longer to walk through. Or worse yet, consider the developer who doesn’t use indentation at ALL and try to walk through their code to figure out what’s going on (I’ve personally come across both style of coders, my boss falls into the latter group).
            Code Standards and Coding Style DOES matter, even if it’s only you working on the code.
            … stepping off my soapbox now

      • Bryan Oakley

        The main advantage as I see it is that everyone on a project seems the same code. While it should be avoided, we sometimes like to line stuff up in columns, or align multiple lines of code or data so that it’s easy to read. These alignments simply don’t survive varying tab widths. Combined with the fact that you can’t see tabs, so “foobar” may appear as “foo bar” or “foo bar”.

        Perhaps the real debate is simply between people that see that as a problem, and people that don’t.

    • ever heard of minification? It uses the same principle as the one you’re arguing for, which is who would want a bigger file size 🙂
      Got my tab key to insert 2 spaces on vim

    • Ole Laursen

      No worries, one day you’ll understand why spaces work better when you’re working with other people, and then you’ll switch and be a better colleague, and ultimately earn more.

      If you want to speed up the process, read jwz’ rant. I don’t think reading it is enough, though, it’s a really deep issue.

      I still see indentation issues from time to time in other code, and every single time it’s caused by someone using tabs. Sometimes a previous version of myself.

      • commenter

        Well, for me the ultimate solution to the problem is `go fmt`. It solves the multi-programer problem without sacrificing any principles. I wish more programming languages would supply such tools (code formatting normalization).

      • CeeBee

        It seems to be more a case of “waaah this breaks my software” more than anything. TISA is the best solution.

      • Hernan Silva

        I sincerely would like to know how spaces are better for working in a team, I’ve seen this as an argument several times but I can’t find why… I mean, how is it that you would not mess up with spaces and would with tabs? If all developers on your team are using tabs, how would spaces benefit the team or its members?

        • Bryan Oakley

          The main reason is that you quite often can’t see tabs. If you type “foobarbaz”, it may appear as “foobar baz” or “foobar baz” or something in-between, depending on your tab setting. Thus, it can be impossible to distinguish between words separated with a tab and words separated with a single space. Though, I acknowledge that some modern editors will display a symbol for a tab, which solves that problem.

          There’s also the problem that, as programmers, we sometimes like to line stuff up. Due to the nature of code, lining things up with one tab setting may look awful in any other tab setting, thus making the code harder to read for some, easier for others. You can make the argument you should never attempt to neatly line up code, but there are sometimes good reasons to do so.

          Can you work around all these issues with tabs, or simply live with these edge cases? Yeah, probably. The argument for spaces is that these become non-problems that don’t need to be worked around. It’s One Less Thing to worry about.

          • Most people I know who use tabs only use them at the beginning of the line. This allows a semantic “one level of indentation” that the reader can control how large it displays.

            I don’t recommend using tabs to align things, because then you are correct, it won’t work depending on the tab size. (TBH I don’t recommend aligning things at all but that’s an entirely different story)

          • Tim!

            Yes. The correct answer is tabs for indentation, spaces for alignment, and alignment is generally to be discouraged.

            The problem with spaces for indentation has exactly the same foundation as people are complaining about for tab width: one developer wants to use 2 spaces per indent level, the next wants to use 4. With spaces this problem is worse than with tabs because you can’t correct for it properly with local settings. You end up with the first indent (from dev A’s revision #1) at column 2 and the second indent (from dev B’s revision #2) at column 6.

        • Ole Laursen

          We can certainly agree that if everyone always uses tabs consistently and everyone always uses the same editor configured in the same way, then tabs will work fine, and even allow people to use different indentation widths.

          Now, the problem is that those two requirements don’t hold in practice E.g. you need to look at code made by others, and those other people need to edit your code. Once you have a mixture of tabs and spaces, the code will start looking weird for someone, not necessarily you.

          My favourite example is when you look at code written by tab fans who configure their tab width to say 4 spaces. It is often the case that the code isn’t actually consistentely formatted with tabs, so with a default 8 space tab that most editors will use (or view source in the browser for that matter), it looks garbled.

          I’m afraid it’s a real and annoying problem. I used to use tabs myself.

          I’m aware you probably won’t believe me until you’ve experienced it yourself.

          • CeeBee

            So your argument isn’t about spaces nor tabs, it’s about giving up and using spaces because then you don’t need to worry about it. I mean really, that argument could be applied anywhere where there is any sort of debate on how or what to use — package managers, specific packages, etc. … but you can standardize either way, and need to make sure people follow the standard, otherwise you’ll experience breakage no matter which debate it is.
            Or am I missing something?
            To be clear, I *have* experienced this, and not just in the tabs VS spaces scenario.

          • Ole Laursen

            I’m sorry if my opening comment offended you, I was trying to be joking, but I apologize if it came across condescending.

            Now, to your question: The thing is, if everyone uses only spaces or only spaces and 8-space tabs, it mostly works everywhere because all editors and viewers understand spaces (well, HTML interpreters ignore them unless in pre tag, but…) and many viewers also handle 8-space tabs okayish.

            Now someone figured out that you can use tabs as a sort of system, just like when tabulating data. The benefit is it enables people to configure their favourite tab width. And some people do that, and THEN we have the problem because suddenly we have non-standard tabs so the file is going to look different to everyone else than the author and people with editors configured like the author. Worse, the code can end up being inconsistent, unnoticed, and then it can garble up completely for other people. The only way to fight that is to start being careful about the tabs.

            And right there is the point where the slight benefit of tabs just isn’t worth it compared to the downsides.

            You seem to think that you can standardize everyone to use tabs. You can’t. And as long as you can’t, you can’t have custom tab widths without causing trouble for other people, and if you’re going to use 8-space tabs, there really isn’t any benefit at all if you’re using an editor more advanced than notepad. And there are still downsides. My life was simpler when I decided jwz was right and I made my editor not insert 8-space tabs, navigation became much more intuitive.

            Now this is an argument, mostly against inserting non-standard spacing in text that other people may have to look at. 🙂 I don’t think my previous comment was an argument, really, I was just explaining what I’ve come to see.

          • CeeBee

            The fact that people don’t have the same indentation is irrelevant though, unless you’re using tabs *everywhere* on a line rather than sticking to Tabs for Indentation, Spaces for Alignment (TISA) which seems to be a distinction people would rather just throw out and simplify.

            Certainly, though, no matter where you stand on it if you’ve got people mixing it up, which you probably always will unless you employ what I’ve stated elsewhere makes the whole debate moot, it’s going to make a mess either way.

          • CeeBee

            Anyway, yeah, I wasn’t sure how much of that was you just being crude or joking, so..
            Unfortunately people don’t make much of an effort to make that clear either. 😉

    • Papito

      Larger file size? REALLY? Is that what keeps you up at night?

    • Edwin

      until you work in a language in which indentation matters and you work as part of a team.

      For example, in yaml, you have to use spaces because people with 8 space tabs could be confused with those who use 2 tabs with 4 spaces each.

      If you colleagues use 2, 4, or 8 space tabs code will not be aligned for everybody. Only using spaces guarantees it. Readability trumps trying to save bytes.

      • This isn’t true. You use tabs at the start of the line and everyone can use whatever tab size they prefer. That’s the whole point of tabs! They are useful to mean “one level of indentation” and every reader can decide how big they prefer one level of indentation to be.

      • “Readability trumps trying to save bytes.”

        Especially with the ever-widening gap between how few bytes code requires vs how much bandwidth and storage is available.

      • TennSeven

        Uh, no. If you use the tab *key* and it actually inserts 2, 4, or 8 space *characters* into the code, then you do’t really use tabs, you use spaces. However, if I use actual tab *characters* it doesn’t matter if my editor spaces tabbed content at 2, 4, or 8 spaces, when someone else on the team opens it, his or her editor will show it with his or her preferred amount of space. This is the beauty of tabs. I might like my code super-indented and so my tabs look huge, but someone else might prefer really small indents to take up less horizontal space, and that’s what he or she sees.

        Additionally, if someone else prefers spaces, he or she can just tell the editor “change every tab to X spaces” (X being whatever number of spaces he or she prefers) whereas if I use 4 spaces and someone else gets my code and prefers 2, they have to first figure out how many spaces I use for each level, and then run some kind of replace to get things to look how they want it, which is more of a pain.

    • Tomasz Przybysz

      The main advantage of using spaces is that they always display the same way. I know that those who praise tabs use the same exact argument as a disadvantage (or rather the point that tab can be displayed according to ones preference) but this argument is invalid. There is plenty of places in which such a setting cannot be set. Code nowadays is being read end edited in many different ways, not only with an local instance of editor/IDE installed on a developer machine. Let’s take GitHub as example. GitHub has quite narrow, not configurable code view. Tab is displayed as 8 spaces. This means a lot of code is being ‘soft-wrapped’ and split between lines. Especially inconvenient for side-by-side view of a diff.

      • Jimmy Jim

        GitHub can be configured with CSS. Change tab-size to whatever you want.

  • Pax

    You didn’t account for age of developer. Age is likely to track with salary. The reason spaces are encouraged when training coders has to do with printing on paper. So older developers will have a different habit then newer developers.

    • Tyler Hibbard

      Readability concerns are valid on screen just as much as on print. I don’t think that is a factor, though age tracking with salary should be accounted for.

      • Pax

        yes but readability on a screen that can be resized at will and has in infinite line length ( and also adjust tab spacing automatically) is a very different consideration then readability on a printed page that has a fixed with of 80 characters before it wraps, will be printed in12 pt font and will treat all tabs as representing a specific amount of space and the amount differs on different printing devices etc. Readability is important on both it is just when you have a screen you can adjust at will and software that fixes the tabs so the line up automatically running , tabs aren’t a problem. They become more of a concern on printing devices especially ones that don’t support soft tabs as treat each tab as fixed amount of space.

    • jdkolassa

      Interesting hypothesis. I wonder about age correlating with printing on paper; I’m in my twenties but I will sometimes print out code on a piece of paper to examine, just to get away from the monitor and jostle my brain into focusing more on it.

    • Tim McClarren

      That is not why.

    • Bryan Oakley

      I’ve been a developer since the 80’s. Never once did I think about the ramifications of printing when thinking about spaces or tabs.

      • Pax

        It was something driven into me when I was a military contractor in the ’00 because they needed to print documents for code for the customer.

    • David Robinson

      We accounted for years of experience, in both the regression and the first chart.

      • CeeBee

        But not age of developer. There’s a distinction.

        • David Robinson

          We didn’t ask about age in the 2017 survey, but we did in the 2015 survey (as well as asking about tabs/spaces and salary), and the effect on salary is the same. Data here: https://insights.stackoverflow.com/survey

          Nor can one find a tendency where developers with the same years of experience that used tabs tended to be younger

          • CeeBee

            Good to know, thanks.

      • Pax

        oh, good to know. I don’t see it mentioned in any of your charts or summary so it is hard to tell.

    • The thing that’s difficult about this explanation is that level of experience tracks pretty consistently.

      In general, older employees do have a higher salary floor. However, developers with the same level of experience most likely trained for it around the same time, so they very likely learned the same habits. A 35-year-old with 5 years of experience probably started learning around the same time that a 25-year-old with the same experience did, so they’re more likely to learn the same kinds of habits. I mean it’s possible that some people set aside their development careers for a decade, but I doubt that is a large enough population to explain the results.

      If age was a primary factor in the pay gap, I would expect that at the very least, the older languages would stand out in the regression chart.

      • Pax

        why, just because I was originally trained in C++ and Modula II doesn’t mean I use them anymore. I’m currently working in C# doing MVC/razor web development. Might be harder to transition to an open source stack because no one has been willing to pay me to work in one, but I am familiar with several. To me it seems like blatant ageism to assume because someone has been in the industry for 20 years they favor or are currently using old languages.

        • That was not my intent, I apologize. The way I interpreted the post/survey, respondents didn’t have to choose only their current languages, so it seemed natural to assume developers who started earlier would be over-represented in older languages. (To be fair, something like Assembly would probably be more like embedded systems programmers)

          Regardless though, we don’t have the age data to do anything more than guess at its effect on the results.

          • Pax

            David Robinson
            said they did include the age data, but I don’t see it in the charts or elsewhere. So it may already be a disproved hypothesis.

  • iusenotabsorspacesanywhere

    • minus Seven

      you
      should
      use
      new
      line
      instead
      its
      amazing
      .
      Writing
      this
      comment
      made
      me
      hate
      myself
      .

      • Kyle Strand

        I had a coworker who did essentially this. He also had incredibly long (sometimes 80+ characters!!) names for everything (classes, methods, variables….)

        Here’s a made-up example (C++):

        ProcConnectionHandle
        ProductNameInstrumentSystem
        ::createNewProcConnection_maybe_fromProcConnectionPool(
        ProcConnectionPool& proc_connection_pool,
        ProcConnectionStatus proc_connection_status_initial,
        MyReadWriteMutexLock my_read_write_mutex_lock_for_proc_connection_pool,
        ProcConnectionId proc_connection_id,
        ProcConnectionAddressIpv4 proc_connection_address_ipv4,
        ProcConnectionPortNumber proc_connection_port_number)
        {
        ……

        • Robin Munn

          Wow… You have my sympathy for having had to read that. That’s just awful.

  • Tony Adams

    I just switched to spaces. Maybe I should ask for a raise.

  • Lincoln

    spaces 4 lyfe

  • Frank

    I hate 17.5% of pro programmers

    • You can set your editor to automatically translate all tabs to spaces. You’ll be able to love programmers again, since you won’t even notice the ones using tabs—unless they tell you.

      • Václav Haisman

        Sure he will notice. He will likely set his editor to expand tabs to wrong number of spaces, given how many possibilities there are, and all the code will look fugly.

  • Félix Gagnon-Grenier

    I’m amazed that so many tab users believe space users press the space key for indentation… Like really? this is so uninsightful I’m almost convinced space users really make more money…

    • CeeBee

      We don’t. Check the other responses to see some space users *actually do* that.

      • Félix Gagnon-Grenier

        no, they don’t, except in a tv show.

        • CeeBee

          I’d like to think people don’t hammer the space bar, too, but there quite seriously are people who admitted to it right here in the comments; Don’t take my word for it.

          • Paul Ishak

            Tabs cause problems when reusing code, thats why i use the 4 spaces setting in notepad++ that replaces tabs as thier pressed. best of both worlds, press tab key to get 4 spaces per press.

          • CeeBee

            How? Spaces cause problems when reusing code, . . . same argument can be applied if what you’re talking about is mixing them; Is that what you mean? Really, a good IDE will change spacestabs as applicable, and if that’s not what you mean I’d need a clarification.

          • Paul Ishak

            Another thing is the size of tabs aren’t always consistant with dofferent fonts… a tab is really just four spaces when typed on paper… personally, for me, a programmer of over 40 years, tabs have always been ugly when coding. not to mention when you start using different character sets. igh it can be a real nightmare…

          • CeeBee

            That’s a terrible argument considering the point is for them to be variable in size, but then again code editors were never made to properly understand tabs. Besides, spaces are generally much more variable than tabs in different fonts, I mean considering you get the whole fixed versus variable width fonts into the argument . . .

            AFAIK #9 is #9 regardless of the character set, care to enlighten me on that one?

          • Paul Ishak

            No i’ll just wait until you’ve gained enough experience to encounter some of the issues that are known to space users, and if you never do then good for you!

          • I like how you gained at least 6 years of experience in 18 minutes lol “my 34 years” “for me, a programmer of over 40 years”

            I mean I agree with you, copy and paste of code (provided you wrote it, trust its author, or at least read it thoroughly) is a pretty normal thing to do. But still, maybe pick a year?

          • Paul Ishak

            that was a typo lol im on my cell phone. good catch though!

          • commenter

            Btw. when you reuse code by copy and pasting you are doing something wrong.

          • Paul Ishak

            What makes you think copying and pasting is wrong? I think it’s funny that as a professional programmer you would ever even say that. Aparrently you’ve never had a colleague email you a snippet, or reused code from other livraries where you only needed one function, or copied code from a template into a new file. I guess its your ___ years of experience as a programmer vs my 34 years.

          • commenter

            Well, that statement was not meant to insult you. It is just that I can still remember my first programing professor telling us ‘everytime you copy and paste code you are doing something wrong’ and over the years there are few statements which I found so true. Yes, sometimes we have boilerplate code which we copy as a template, like a default HTML file. But everytime you copy code you risk that you have to fix a bug in that code in two places at a later time.

            So I found that advice very helpful.

          • Paul Ishak

            Understandable, but I’m not here for programming 101… to insinuate that anyone who would copy and paste code under any circumstance is doing something wrong… is a bit misrepresenting of your own reasoning ability…

          • 40YO senior dev chiming in here. Copy-pasting code is a trap, because you don’t learn anything. Do it consistently for 30 years and you end up like a bunch of other poor old sods I’ve met who stopped learning, and atrophied.

            Copy-pasting is not always bad, but copy-pasting from Stack Overflow day in and day out is a deadly, deadly trap.

            I can only ask you trust me on that. I’ve seen what it does to people over time.

          • Paul Ishak

            I think I can respectfully disagree without having to break my reasons down to neutron science.

          • Mario Rivera

            Why does copy pasting imply not undestanding the code?

            Moreover, in my experience, “xxx years senior” labels indicate bad programmers. Good programmers don’t need to use the word “senior”.

          • Joshua Lamusga

            I copy and paste code all day along. It saves me hours of time. The alternatives are (A) spend way too much time reinventing the wheel, or (B) pointlessly retype it all out the exact same. Copy -> paste -> review. Every time.

          • commenter

            How about using libraries? Or inheritance when you are using an OO language?

          • Joshua Lamusga

            Then you acknowledge that copy-pasting the code won’t work if you don’t have the library and can’t reference/include it. If you’re inheriting from a non-existent class and can’t make use of a similar class in your code, you shouldn’t copy-paste. With great power comes great responsibility, or something like that.

          • commenter

            Well, I am not sure if you get my point. I am not against code reuse. I say code reuse is great (because it saves a lot of time). I am against duplicating code. So if the code you need exists in a library, use that library. But please do not copy the code from the library, but instead load the library, so that you can easily update it if there comes a better version at a later time.

          • Mario Rivera

            You’ve obviously never worked on real-life problems.

          • Mario Rivera

            What about that?

          • Paul Ishak

            Especially when your clients pay over $100 an hour… You don’t get the luxury of proving you’re a coding ace… Unless you don’t really care about your clients time and trust, and your ego means more to tou. I say copy and paste as much as humanly possible…

          • Mario Rivera

            A foolish consistency is the hobgoblin of little minds.

          • Mario Rivera

            Nothing wrong with reusing code by copy pasting.

          • Félix Gagnon-Grenier

            You’re right, it appears a few confused poor sods do it! However, it’s *far* from the majority, and my point that most people that think otherwise are misguided stands.

            Likewise, don’t take my word for it.

          • CeeBee

            That’s also my point, though 🙂 There are *some* people who hammer the space bar, and there are *some* people who think that’s the alternative to using tabs, but that’s far from the majority — on either side.
            I think we are both agreeing on that.

      • Paul Ishak

        Another thingI want to say for notepad++ users is heaven forbid you recieve a file from a colleague who uses tabs when everyone else in the office uses spaces… God that is always a pain in the ass… Same goes for programmers who leave encoding on ascii, but have utf8 characters in their code… definitly annoying.

        • CeeBee

          …and vice versa, so y’know.. we technically agree on that.
          As for encoding, yeah, that’s definitely an issue.

        • Mario Rivera

          Replace leading space with tabs, or replace leading tabs with space. It’s one regular expression: any editor lets you do that. What is the problem?

    • Bones Justice

      Oh my, can you imagine? I strongly prefer spaces, but I would rather use tabs than listen to colleagues whack away at their space bars all day. Hell, I’d rather use no indentation at all.

    • Edwin Ramirez

      Like really? ANY code/text editore/IDE lets you set your tab key to any amount of spaces you want. I ident with spaces but I’m not stupid enough to smash my space bar 2-6 times for each new line. Come on guys and gals.

  • I used tabs but configured my editor to put 4 spaces…

    • Bryan Oakley

      So, you don’t use tabs. You use the tab _key_, but you don’t use tabs.

      • Chris G.

        We just figured it out!!!!

        People who respond Spaces are those who were smart enough to realize that ‘Tabs’ doesn’t mean “I use the tab key” but rather “I use the tab character”.

        ‘Tab’ users is ‘Uses Tab Character’ + ‘Uses Tab Key but Space Character, but doesn’t understand the distinction’. My theory is that ‘Uses Tab Character’ has roughly the same salary as ‘Uses Space Character’ but ‘Uses Tab Key and Space Character, but doesn’t understand the distinction’ makes substantially less as to drag down the average.

  • Frank

    Using Notepad++, I don’t have to trade tabs for spaces in order to save space. I can setup my tabulations to appear like 2 spaces without having it to be two spaces, which would be 2 characters instead of just one, making all my files larger.

    • Bryan Oakley

      If you’re optimizing for source code file size, you’re doing something wrong.

    • Not Projecting

      That applies to almost any IDE for the past 40 years. It’s not a debate about which key you indent with, it’s about which ASCII character.

      • RadthorDax

        Or indeed *how many* ASCII characters.

  • Alex Artushin

    Kind of an interesting situation with Go. From the graph it looks like a dev who uses spaces has a median salary in the 70’s while a dev who uses tabs is in the 50’s. However, any Go developer worth their salt is going to use `go fmt` to reformat their code on save, which will switch to tabs automatically.

    • Iron Sean

      A Go user might not only program in Go though, and would indicate tabs. spaces. or both depending on their preference in other languages where they have a choice. But for the purposes of this analysis they still have a set of answers either way for users who also said they use Go.

  • commenter

    I took a quick look at the data (30 minutes) and found the following insights regarding Tabs vs. Spaces:

    When you split the group into younger and older programmers (not by age but by experience), into the ones with up to 10 years experience (Group A: 37905) and the ones with more than 10 years (Group B: 25308) you can see the following:

    In Group A (up to 10 years experience)
    Space Users: 26%
    Tab Users: 33%

    In Group B (more than 10 years experience)
    Space Users: 36%
    Tab Users: 31%

    As Programmers with up to ten years are not only novice programmers, but the ones with a more modern education, this leads me to the conclusion, that it is the result of a modern programming style which favors tabs. Btw. over the whole data set there are alreadey more tab users (16682=32,5%) than spaces users (14666=28,5%).

    So my conclusion is that space users probably earn more money as they have more experience, but the trend shows that the new generation tends to favor tabs and that there is already a majority of users who use tabs.

    • Kostya Pogromskiy

      This assumption is controversial to the first chart.

      • commenter

        How? Please explain.

        • Kostya Pogromskiy

          You say that space users earn more money as they have more experience, but the chart shows that developers with the same experience makes different amount of money depending on their tabs|spaces preferences.

          • commenter

            You are correct, my conclusion is wrong as I did not mean that they earn more money right now, but that they will earn more money in the future as there will be more tab users with more experience and right now the majority of tab users has less experience. So my hypothesis is that tab users will not switch their style when they gain experience but that they will stick with their style and that their group will mature over time and make more money by then. I will correct that.

    • Noel Hibbard

      I have about 9 years of coding and I am a tabber. My father has been coding for almost 40 years and he is a spacer. You hear him all day… bang bang bang bang on the space bar. I put my money on your hypothesis.

    • I think you might be onto something with the age thing – a 30-year-old junior developer would probably make more than a 20-year-old in the same position due to several factors (better negotiating skills, more ‘real world’ time, that sort of thing).

      Though on the other hand, the number of older developers who learned during space days and set it aside until now is probably pretty low, so maybe that’s not the deciding factor…

    • msg

      There are three obvious hypotheses about the evolution of a technical practice when an older generation doesn’t agree with a younger generation.

      1) Dinosaur: the old way is going to die off when those dinosaurs go extinct
      2) Child: the young way is going to die off when those children grow up and go to war
      3) Idealist: the issue will be decided through humble give and take and rational tradeoff analyses

      I tried to frame this in terms of insult throwing.

      I hit the tab key and it makes spaces appear in Emacs. This is the only true way. /sarcasm

      See the links on this JWZ trackback.

      https://www.jwz.org/blog/2017/06/developers-who-use-spaces-make-more-money-than-those-who-use-tabs/

      Key quote: “My opinion is that the best way to solve the technical issues is to mandate that the ASCII #9 TAB character never appear in disk files: program your editor to expand TABs to an appropriate number of spaces before writing the lines to disk.”

  • Mark Lapasa

    I tried using Spaces once, it was awful

    • Marios Santamaria

      my salary kept increasing beyond control, I eventually had to go back to tabs

  • TheBox193
    • RagnarDanneskjöld

      I scrolled down to post this same xkcd : ))

    • Mike

      You didn’t read the article did you? I will help you out:

      “Correlation is not causation, and we can never be sure that we’ve controlled for all the confounding factors present in a dataset. If you’re a data scientist, statistician, or analyst, I encourage you to download download the raw survey data and examine it for yourself.”

      • Did read, and I recognize the author recognizes that as well as did statistical effort to explore the dat. Still funny. 😉

      • A couple of paragraphs before that one it reads:

        “The model estimated that using spaces instead of tabs leads to a 8.6% higher salary […]”

        Despite the disclaimer in the conclusion, that statement implies causation.

    • Fun joke. Not relevant here. The author was clear that correlation != causation. Several times.

  • camainc

    I’m a 32nd Degree Master Tabster

  • Lynx

    Spaces is the right answer, no matter what. Most languages are multy-platform. Spaces looks same on any platform and this is not the case for tabs. Just accept it.

    • vim

      spaces gives way to the “how many” discussion, while tabs can be formatted to taste and there is no “how many spaces” discussion.
      computers (parsers, compilers) don’t care, so there is no technical argument.

      = there is no right answer, it is a matter of convention / doctrine

      disclaimer: using spaces but hate having to reformat files (and ruin the git annotation that way) to the point where i think: tabs don’t have this issue.

      • jr1

        lol explain this to my boss who is unapologetically a tabs man.

    • sosiosh

      The whole point of formatting is to make code readable to OTHER humans. Wouldn’t it be nice if there were a technology that adapted to everyone’s personal preference.?

    • TennSeven

      With spaces though you have different developers who use different numbers for each level of indentation. With tabs one tab is always one level of indentation. As for “looking the same,” any person on any platform can make tabs look however they want, or change them to their preferred number of spaces, with a single keypress.

  • Shirish

    ..

  • figital

    The HTML in this clickbait is tabbed with tabs.

    • Mike

      People are over using the word “clickbait”. The title of this blog is in no way shape or form clickbait. Click bait would be:

      “Some programmers make more money that others, read the SHOCKING reason why!!!”

      • Michael Clark

        “Google Developers hate him! Learn how he increased his salary with this one little trick!”

    • They actually mix tabs and spaces.

  • Dave Dyer

    Dude. This is a brilliant study idea, but you should modify your result to only apply to the sampled. This is an observational study, so you can’t claim causation. Visual analysis of confounding variables isn’t enough to claim causation. That being said, you *could* do some random sampling and randomly assign treatment groups if you raise a bunch of babies, randomly indoctrinating them from age 3 to either tabs or spaces, and tracking their salaries over time (with some mechanism to handle serial effects).

    Anyway, yeah, what xkcd said. But still, brilliant idea 🙂

    • Kyle Strand

      The article itself says “Correlation is not causation, and we can never be sure that we’ve controlled for all the confounding factors present in a dataset.”

  • minus Seven

    WHAT KIND OF CIRCLE JERK POST IS THIS…….
    I would have expected better from stackoverflow.
    There is no reason given in the article to explain why.
    Correlation is not equal to Causation.

    • Scott Lavigne

      Did you even read the conclusion?

    • s73v3r

      Yes, they even say that in their post. It’s just an interesting piece of data. They have no idea why it is, it just is.

    • Mike

      You didn’t read the article did you? I will help you out:

      “Correlation is not causation, and we can never be sure that we’ve controlled for all the confounding factors present in a dataset. If you’re a data scientist, statistician, or analyst, I encourage you to download download the raw survey data and examine it for yourself.”

    • It says Correlation is not Causation in the conclusion. This is an interesting and amusing article and that’s all.

  • RadthorDax

    Add a new question on to the survey for next year asking if developers limit character length of their lines to 80 characters. Then see if this correlates with space-use.

  • What of developers who mix tabs and spaces? 😛

    • Kevin Smith

      They are to be exiled to a horrific world where the only language available is PHP and the only editor is ed.

      • jr1

        the only language should be something worse…

        • sheanmassey

          COBOL?

        • Kevin Smith

          If it were worse than PHP, they might give up. PHP is just barely viable enough to entice them to keep going, thus prolonging their suffering.

      • CeeBee

        Or JavaScript.

    • Vrae

      It actually describes people who replied “Both” as being indistinguishable to just tabs.

      • Both is not the same as mixed. I would reply “both”, because I use tabs for some programming languages, and spaces for other languages — but never both in the same document. *Mixing* tabs and spaces, on the other hand, implies using tabs and spaces within the same document (and indeed, sometimes on the same line).

    • Jimmy

      RTFA

      • Please tell me where the article talks of _mixing_ tabs and spaces? Using both tabs and spaces is not the same: I use tabs for some languages, and spaces for others. I never mix the two in a single document.

    • Iron Sean

      It’s referenced right there in the very first graph and paragraph. You really didn’t read, did you…

      • It references ‘using’ both tabs and spaces not mixing them. At Cratejoy, we use spaces in Python and tabs for Javascript and Less but we never mix tabs and spaces in a file.

      • Please learn to read what the article actually says, not what you think it says. 😛

        “Both” is not the same as “mixed”. I use both tabs and spaces, because I use tabs for some programming languages, and spaces for other languages — but I never mix them: never both in the same document. Mixing tabs and spaces implies using tabs and spaces within the same document (and indeed, sometimes on the same line).

  • jr1

    opinionated and irrelevant. also incorrect findings.

    • mmmpop

      I like think most people reading this would see it the opposite way and as a great example of meaningless correlation between what comes down to stylistic preferences (in most cases).

    • Dave

      What are the correct findings?

    • Kyle Strand

      Also, what’s the “opinion” being presented here? The author is presenting data and even states that the results are “surprising” and unexpected.

      • Joshbeast

        It is my opinion that the title is the opinion. The data sample is flawed in that his sample was chosen in a way that has a misleading trend that fits the title of the article to make it look like the correlation is the cause, when the statistic says more about his sampling techniques than it does about who gets paid more.
        For example, only people who knew about this survey or visited a certain site or subset of sites were surveyed. To illustrate: “Just because most people from a certain state might be ass[hat]s doesn’t mean that living there makes you that way.”

        OP, have a frickin snack.

        • Kyle Strand

          Er, what sampling techniques are you referring to, exactly? The sample is the set of people who took the Stack Overflow survey and answered that question. So obviously a self self-selecting sample, but they did their best to advertise the survey and encourage people to take it, so it’s in no way clear to me that there was a better technique available or that there’s any obvious reason for the sample to over-represent high-earning space users and low-earning tab users.

          Also, the title is still not an opinion; it’s the conclusion drawn from the (publicly available) data.

  • TechUser2011

    Here is a simple explanation: Younger programmers who are just getting started (say, with less than 5 years of experience) do not know the value of readable code (and thus use the tab character to push code farther to the right than spaces), and they do not know all the bells and whistles of their IDE or text editor, so they don’t know that the tab key can be mapped to add spaces.

    More experienced programmers:
    1. understand the value of compressing more code into horizontal width (for easier reading) AND
    2. read StackoverFlow/Usenet and understand that other experienced programmers use spaces AND
    3. know how to change the settings of their IDE to emit spaces when the tab key is pressed.

    • CeeBee

      Well, 1 doesn’t apply size the whole point of tabs is to be able to adjust them (if you prefer one space indentation, hey, tabs make that real easy and you don’t have to ask anyone to change it too) and 2 is more pedantism than experience. Really, spaces just mean “I gave up and didn’t want to deal with my tools”.

    • That’d all make sense except that first chart shows that space developers make more than tab developers on average even with the exact same amount of time in the career field.

    • rumtscho

      Look at the text again: “I fit a linear regression”. A linear regression coefficient tells you how much of the change in the response variable is due to a given input variable *if we hold all other input variables constant*. The linear regression included both programmer experience and tabs vs spaces, so the effect exists even beyond programming experience.

    • TennSeven

      Your first point doesn’t make any sense. Tabs don’t really make code less readable since you can configure your editor or IDE to represent tabs with any amount of space (or any number of spaces) you wish.

      This also makes tabs more versatile, since it’s more difficult taking code with spaces for indentations and modifying it to look how you want (one tab is always equal to one “level” of indentation, whereas different developers use different numbers of spaces for “levels” of indentation). So while anyone who prefers spaces to tabs can take code with tabs and instantly convert it to spaces, or make the tab distance equal to two (or four, or whatever) spaces for readability with a single keypress, someone who prefers two spaces per indent level will have a harder time making code with four spaces per indent level readable to him or her.

      I’ve been a developer for 25 years and I use tabs, and I know how to change my editors and IDEs to emit spaces when I press the tab key (and also just to set my tab width so I can use less horizontal space without futzing with spaces), so your second and third points don’t really make sense either.

      • TechUser2011

        You missed my point 3, didn’t you? Because you are an experienced programmer, you know how to set your IDE to do these tricks, but an inexperienced programmer does not (or does not value doing so).

        • TennSeven

          No, you missed the part of my reply addressing your point 3, “…I know how to change my editors and IDEs to emit spaces when I press the tab key…”

  • Sagar Tanur

    Tabs are good. I can’t agree with this post

    • Iron Sean

      You can’t agree with Statistical Analysis of a data-set of survey responses? This post didn’t show anything to agree or disagree with, it didn’t say one was better than the other, it showed a result from a collected survey.

    • Kevin Smith

      The article makes no claims about the technical merits of tabs vs spaces. It just points out the existence of a correlation.

  • Jack Johansson

    “The StockExchange of tabbed programmers at wallstreet was dropped by 40 points 5 minutes after this post was published.”

    N.Y.T – 6/15/17

  • elastic tabstops ftw

    • Kyle Strand

      If only, if only, if only….

  • Dennis Hort

    Take THAT Richard Hendriks!

  • sheanmassey

    I used to be a strong tab supporter. I would say “just configure your IDE/editor to show however many spaces you want per tab”. Want 4 spaces, 6, 8 spaces? It’s just an IDE issue. Then I joined teams where the 2 were being mixed all over the place. Now I’m a spaces guy. Because what I see on my screen is what you’ll see on your screen, and vice versa, no matter what. It took me 5 years to realize the importance of this. Spaces > Tabs.

    • Jacob Stamm

      I’m confused. Once you’ve configured your IDE to convert tabs to spaces, that already solves the issue you mentioned. Are you saying you literally press the space bar for indentation?

      • John Reno

        I think he’s saying that as soon as one developer on the team decides to use spaces then everyone is forced to.

        • Nitin

          Forced to explain to that one developer that they’re part of a team?

      • sheanmassey

        Haha, of course not. What I’m saying is the mix of tabs and spaces in code that’s being touched by a team of people, each using their preferred IDE/editor and settings. Some using actual tabs, others using spaces. It get’s annoying fast.

        Personally these are my preferred settings (vim):

        set tabstop=4
        set expandtab
        set softtabstop=4
        set shiftwidth=4

        • Jacob Stamm

          What do those settings mean for those of us who aren’t Linux vim programmers?

          • sheanmassey

            A tab key gets converted to 4 spaces. A back space at a position of “column mod 4 == 0” removes 4 spaces. So you get space characters from tab keys but that also behave like tabs on backspaces too. This is especially nice for python, my go-to money maker.

      • Evan Sullivan

        No. He’s saying that he used to have his tab key insert the tab character. He liked that because you can configure how many spaces your IDE renders a TAB as. If you want tabs to look like 4 spaces, you can set that. If 2, you can set that as well. The IDE will render the tab how you wish, but it’s still a tab character in the file.

        He discovered that was a problem in files that mixed tabs and spaces because how your IDE renders tabs might differ from how many spaces someone inserted. If everybody uses spaces and not tab characters, the file will render the same for everyone. I’m sure the OP uses the tab key to insert his space-character indents.

  • Adam Patterson

    My hypothesis: Somebody who touts their use of spaces is more likely to exaggerate their reported income. It sounds pretentious. “I am above using tabs” or “I am better than you”.

  • sheanmassey

    also.. fwiw:

    set tabstop=4
    set expandtab
    set softtabstop=4
    set shiftwidth=4

    End of discussion.

    • Corey Wischmeyer

      I added this to my vimrc and my boss just bumped my salary! Thanks!

    • Red Cricket
      • jbw

        Ctrl+v -> tab -> outputs a tab character regardless of the above config in vim. TMYK

      • sheanmassey

        Me too! 🙂

      • graywh

        Thankfully, vim’s default Makefile config unsets ‘expandtab’.

        • Red Cricket

          cool! didn’t know that.

    • Rörd Hinrichsen

      ITYM

      (set-default ‘indent-tabs-mode nil)

  • So, one who uses space instead of tabs makes more money!!! How is this logical?

    • Klaus Stock

      The coice of programming language influences the decision of spaces vs. tabs.

      • Kyle Strand

        The author adjusted for that.

    • Kyle Strand

      “…this is certainly a surprising result, one that I didn’t expect to find when I started exploring the data.”

      The point of empirical investigation is not “logic” but merely data collection and statistical analysis. The fact that something is true doesn’t make it logical, nor are logically sound ideas necessarily true.

  • Billy Hinners

    Maybe the title of this article should be “Developers who use spaces more likely to exaggerate salary claims”?

  • Potato

    Great! Meanwhile blocker bugs in the SO/SE sites are well and alive! Way to go!

    • One of these days we’ll convince our data scientists to stop looking at data and fix bugs instead. Don’t give up hope!

      • Jerry Coffin

        Perhaps we could, instead, convince SO to hire more/better developers instead of wasting money on data scientists who apparently have little enough useful work to do that they have quite a bit of time to waste?

        And yes, I’m aware that SO have job ads out, so they’re trying to hire developers. Maybe the problem is in the supply chain: too many people being trained as data scientists, and too few as developers (though in fairness, the data scientists I’ve met don’t strike me as people who’d be great developers if they had different training).

        • Félix Gagnon-Grenier

          This argument of “meanwhile, […]” is very unsound. Like, meanwhile, children are dying in africa, stop using your computer and do something about it. If your job is not in health, teaching or food making, you are useless, so you should stop wasting your time.

          kids these days…

      • Nutarama

        You have enough work to justify the salaries of more than one data scientist?

    • Layton Miller

      Mah gawd you guys, who cares? Its a big company, you don’t complain about random studies that Google does, do you? While some studies may seem pointless, one could argue that all minute studies are pointless given no context, yet here we are talking to each other through the internet, having never met in real life, because of what were arguably at the time an enormous quantity of “pointless studies” done throughout history to sufficiently advance technology to the point that we can do exactly this.

      If we put this kind of scrutiny on the SO data scientists, imagine what kind of scrutiny we could put on what YOU do all day, such as…. oh, I don’t know, read the “pointless studies” that you’re complaining about, and then comment on replies of comments, perhaps?

      Hmmmmmmm?
      Hmmmmmmmmmmmmmmm?
      [trollface]

  • One
    of these groups is skilled enough to modify their editor to replace `TAB` with two spaces. The others can’t figure out how to exit vim.

    • Klaus Stock

      Ctrl+Z, pkill -9 vi 😉

      • Craig Allen

        Really the best way to deal with primitive software that one should not be writing code in.

        • Some of the best devs on the planet use vim. It’s a badge of honour.

          • John

            The majority of the devs on the frontier of new languages, and language research, use an editor like vim. The IDEs haven’t been created yet.

          • Craig Allen

            The majority of what I hear from that field is editors like sublime & np++, where one can define/redefine new language syntax on the fly to test with syntax checking and iterate quickly.

          • John

            That’s fine for lazier people, but acting like you can iterate faster by preferring them to vim is just dishonest.

          • Craig Allen

            To be sure. I’ve seen some godamn wizards with vi, but in 30 years, the wizards will be using the more evolved tools, because they offer better returns for the same experience. Mostly, anyway, I don’t think console editors will ever obsolesce completely, but it does a disservice to developers to push tools like vim as objectively better, as people tend to do.

          • In 30 years, vi will 71 years old, and vim will be 55 years old. All of us are hoping for better, more functional tools in that timeframe. But for now, the universality and raw power of vi & vim is hard to ignore.

          • As a vi user myself since the early 80s, I’m not really seeing that happening (though I’d be quite interested to be proved wrong). I’ll be the first to admit that Emacs has it all over vim when it comes to power, but I don’t use vim because it’s a powerful editor: I use it because it makes life really easy when doing basic text editing through features such as keeping my fingers on the home row. Everything else happens in another window at a shell prompt.

            when I want to make editing more efficient, I fix my language or write a new one, which has the added advantage of making reading, as well as editing, more efficient. When I need to make anything else more efficient, I update my command-line programs.

            Don’t take this as me trying to dis Emacs or your particular editor/IDE/working method/whatever of choice here. It’s not that I don’t do that (I think that Textmate is an abomination that should be wiped off the earth with all of it’s users, for example), but I do recognise that what experienced people do in Emacs-land can be just as productive as my way of working. I just want to point out that experienced vim users are using an entire ecosystem of tools, just not vim, do pointing out that vim doesn’t do X doesn’t mean that vim users can’t or don’t do X. There’s no reason everything you do has to be done by you editor.

          • commenter

            Well, actually it depends on what you value. If you want something feature rich, an IDE might be objectively better. If you just want to edit a few lines of source code, the small editor which is just an editor might be objectively better.

            The power of Vim is that it starts as a very small and slick editor but can become a feature rich slow mess with the right plugins 😉 I am sure this is nothing new to you, I just wanted to say that ‘objectively better’ says nothing without any KPIs.

          • KlingOn2K

            Yeah right – like we need to memorize a zillion keyboard shortcuts to do the most obvious stuff !!
            Keeping up with tech is tough as it is, we need our memory for more important stuff.

      • Turn it off and on again.

    • Anonymous Coward

      Did you just assume how many spaces I use for tabs?!

      • John

        Is that like assuming your gender?

    • Tristan Hyams

      4 spaces for Windows devs.

    • “Here’s a nickel kid, get yourself a real whitespace character.”

    • :!sudo shutdown -P now

  • Biggest bullshit I’ve ever read

    • Kyle Strand

      Sounds like you must be a tab user. BURN THE HERETIC!

      • GonzoI

        If you insist, heretic. Stand still.

    • Félix Gagnon-Grenier

      dude… calm down.

    • Marco Ko

      that’s exactly the intention of the author – using the temptative conclusions of an association study to teach sth else. it’s satirical..

  • Marijana Larma

    I suggest the ones using spaces might be largely the ones who believe they are better and have higher standards when negotiating a salary. Which is not necessarily a bad thing.

  • Chris G.

    People who respond ‘Spaces’ are those who were able to differentiate between “I use the tab key” and “I use the tab character”.

    ‘Tabs’ and ‘Both’ users include:
    1. Developers who cannot understand the distinction between ‘Uses Tab Character’ and ‘Uses Tab Key but Space Character’
    2. Developers who cannot extrapolate full solutions from limited information.
    2. Developers who understand the distinction but don’t care about consistency.
    3. Developers who don’t/can’t change the IDE default settings.

    My theory is that ‘Uses Tab Character’ has roughly the same salary as ‘Uses Space Character’ but those who doesn’t understand the distinction make substantially less as to drag down the average for ‘Tabs’ and ‘Both’.

    • Félix Gagnon-Grenier

      Funny, a few days ago, I would have found unbelievable that someone would actually think of tabs as the tab key. Reading the comments here, I am baffled to see that not only do some really don’t see the difference, but these also think space users actually use the space key….

      Amazing.

      • Adam Jorgensen

        I blame that episode of Silicon Valley 🙂

        But in all seriousness, yes, this is a rather mind-bending discovery.

        It also bends my mind that some people fail to understand that the ambiguity inherent in using tab characters is the very reason why space characters are strongly preferred by anyone capable of thinking logically.

        • Stephen Ostermiller

          That ambiguity is a feature of tabs, not a bug. Those of us that like compact code with two space indentation can coexist peacefully with our coworkers that use 4 space tabs. As long as tab characters are in the code it is just a editor setting and both groups can be happy. Even that one weirdo that prefers 8 spaces per tab can do his thing without bothering the rest of us.

          • Adam Jorgensen

            If you genuinely think ambiguity is a feature then I can only conclude you’ve never had to work with timezones and DST transitions 🙂

    • NoSir

      do you even read? medians differ

      • Chris G.

        You’re right. Fixed it from average to median. Though the argument still stands either way. The volume of low salary developers who cannot make the distinction brings down the median.

  • Red Cricket

    Maybe developers that use spaces exaggerate.

    • Paulo Reichert

      You’re probably right as we all know you can’t trust developers that use spaces.

  • Erno

    It’s simple. Programmers get paid per character.

  • Chip Overclock®

    Salary aside, I was a tabber for decades. And it was the predominant coding standard at many of my employers and clients. Then one day my friend and colleague Doug Y. remarked “tabs have to be rendered, spaces do not”. That tiny little piece of wisdom was my Road to Damascus moment. I’ve been a spacer ever since.

    • Luna

      They disappear when its minified.

    • GonzoI

      There is a bit of throwback in it. Tabs are faster to type, and IDE replacement is relatively new. Tabs are also a single character, and code files not having to count bytes is also relatively new. There is a lot of lag between the professional world moving past a paradigm, the educational world adopting that change, and the post-change students getting into the workforce.

      • Guilherme Taffarel Bergamin

        How much relative? I’ve been to a VB6 project where we used the tab key for inserting spaces. VB6 IDE is even smart enough to understand where the level of indentation ends and add only the correct amount of spaces…

        • GonzoI

          30 years. While that’s a lot in technology terms, it’s below the turnaround rate for a lot of major universities. I say this from experience both as a student coming out with 30 year out-of-date habits that I had to get rid of, and having trained several recent grads out of their school-taught habits that were based on green-screen limitations.

          • Guilherme Taffarel Bergamin

            wow, thank you for your cumpliment 🙂 now I feel I am myself relatively young hehehe (I am 30 years old)

            ok… so you are talking about 30 year old IDEs that can’t automatically transform a tab into spaces… I guess if I were a programmer back then, I would most likely only use tabs and ask myself why would anybody use spaces instead because you would need to hit the space bar 4 times while the tab does it in one…

            But we are talking about the present and in the present, nobody is required to hit the spacebar 4 times for each indentation level. Even if you are working with such an old language because you can use other editors instead of those IDEs

          • GonzoI

            I’m older, but not quite that much older than you (I deny the existence of the looming 40). Contrary to popular belief, you can learn about obsolete things. 😛

            I suppose I do have an “advantage” in that area because I’m from a rural area. My high school was teaching us to use computers on green screen terminals in the late 90s. My first year of college, I coded for a Fortran77 compiler, was assigned a 286 frankencomputer for a literary club I joined (as the only technical person in the club, I got saddled with making it work), logged into yet another green screen terminal for submitting projects in, ironically, my C++ class (The Fortran class was submitted on disk, but was compiled through DOS command line on Windows 95 computers), and got lectures on file space limitations that were prefaced by an explanation of old technology. In most of my classes, there were then-modern IDE options available, but the free versions often weren’t compatible with our archaic compilers.

            I also worked as an adjunct professor for a while, and as part of the IT staff for a college, and with IT professors from 5 other universities. The problem is the university’s internal cycles, and how long it takes to get a degree and teach a professor. A study I read while looking into it while arguing with a professor over it is where I’m getting the specific “30 year” figure, so my 30 years is itself almost 20 years out of date. I do still keep in touch with universities, though, and it’s not getting a lot better. In my state, I suspect it’s going to get worse now that our governor has decided to gut the education system in favor of his ego.

            As for the present, no one is sitting over your shoulder telling you to change your typing habits. If you picked up the habit of rapidspacing in college, there’s no impetus to change it.

          • Guilherme Taffarel Bergamin

            Yes, nobody needs to be over your shoulder telling you to change your typing habits, because it is not needed anymore. It doesn’t really make much difference…

  • rmonster

    I think causation is backwards here.

    Programmers that get paid more are more likely to be required to use spaces. I have never worked at a large company with a coding standard that requires tabs over spaces.

    • Guilherme Taffarel Bergamin

      Interestingly, I’ve never worked at a company that stated which pattern we should use, but never seen a professional code where tabs were been historically used instead of spaces. I have used tabs only during the course of my graduation where everything works and looks good. The real world requires you to use spaces.

    • Zapados

      I think you got it!

      Spaces are more likely required when working on a code base that more than one person is working on, since you don’t know how someone’s editor will render tabs (2 characters, 4, 8?). People using tabs work at larger companies and therefore make more money.

      • Zapados

        And of course that was a typo….
        “People using SPACES work at larger companies and therefore make more money.”

    • John

      Company size seems to have been controlled for though. I’d expect that to be a good enough proxy for team size.

      Perhaps it’s that, all else being equal, maintaining a codebase with tabs requires a small amount of extra effort which could have been spent on shipping features 🙂

  • Robert Boehne

    If one never shares code, or has no concern for the next reader (who may use a different editor) tabs/spaces don’t make much difference. So, developers who know the difference (and care about the NEXT reader of their code) use spaces to preserve their formatting across tabstop changes. I’d argue that developers who care about the next reader are just better at coding.

    • GonzoI

      Most people in office environments work with a mandated IDE, eliminating the tabstop change question. That said, companies that allow diverse environments or working from personal equipment might pay more but require spaces for that reason.

  • This is all self-reported, yes? What if the conclusion is spaces developers are just inflating their salaries by 8.6%? [trollface]

  • Guilherme Taffarel Bergamin

    I think the survey could have been poorly developed. I didn’t have the chance to answer it, so I can’t really be certain of this, but before asking if people use tabs or spaces, you need to clarify that you are talking about the tab character against 2 or 4 space characters in indentation.

    Those in the beginning of their careers might not understand or even know that the IDE can change the tab key output to spaces, which could explain the lower salary. Also, people with longer experience who still don’t get this, might be the kind of people who are not curious enough to enter the IDE configuration and test possibilities. They tend to only do what they are told.

    My theory is that creative people tend to earn more and changing the default configurations could have correlation in this data.

    • GonzoI

      Or they could know what the IDE configuration is, but assume the question is about which key they press. Like you, I didn’t get asked the question, but in the way it’s phrased above I would say “tabs” even though one IDE converts them into spaces and another doesn’t (putting me in “both”). If I were in only the IDE that converts to spaces, I’d be saying “tabs” even though my output was “spaces”.

      • Guilherme Taffarel Bergamin

        Gonzol, if they were asking for which key one presses for identing, my guess is that 90% would reply “tabs” and not 40%.

        Also, there is no technical difference between using the key tab or the key space making it irrelevant for a survey, while there are technical differences between the character tab and the character space such as filesize and indentation of lines of code written in more than one actual text line or languages without a clear indentation pattern like SQL.

        • GonzoI

          Filesize hasn’t really been treated as a factor since the late 90s. The tab/space characters go away when you compile if it’s a compiled language, and they go away when you minify if it’s a transmitted language. The only difference the actual character makes is in display across multiple IDE configurations. And that actually benefits tabs unless someone goes along typing spaces (sort of like someone shoving fixed-width objects in the midst of a variable width HTML page).

          • Guilherme Taffarel Bergamin

            It doesn’t matter if it has only been treated as a factor recently. It is treated as a factor in the present and that is what matters for a survey about the present.

            In any case, neither of us have answered the survey, which means we can’t really know what they meant by “tabs or spaces”. I just think that a lot more people would use the tab key instead of the space key for indentation and not only 40% and that’s why I think that or they were specifically talking about the character or they didn’t make it clear

  • Opslag Medium

    I’d also ask for more money if my boss insisted on spaces. Like I have nothing better to do all day long than correcting code that starts in columns that are not multiples of 4…

    • Guilherme Taffarel Bergamin

      I don’t know which IDE you use, but I’m pretty sure you can use it to autoindent…

    • Chad Hansen

      Most IDEs nowadays will have an automatic document formatter. Configure it properly with your team’s standards and never worry about code styles again.

      • John

        And for those of us not using IDEs – anyone with any technical competence can run a CL linter, autoformater, or bang out our own script in a few minutes to address the issue permanently.

        My point is: No competent dev needs to waste much time dealing with the problem of spaces.

        • Guilherme Taffarel Bergamin

          Just out of curiosity… Why would anybody not use an IDE?

          • Nutarama

            In some languages it’s faster and easier to write your code in a text editor than in an IDE. This is mostly the case for older languages or specialized languages based on old languages that aren’t object oriented. Also an IDE takes much longer to load than a text editor, which means if you’re testing something and can’t keep your IDE open through the testing, you’re going to prefer using a text editor.

          • Guilherme Taffarel Bergamin

            Nutarama, must be a really old language, then. I had this issue in the past. My first professional coding language was FoxPro for DOS. Its IDE was great for building windows in the DOS environment and all, but the actual coding I used to do on Notepad++.

            At that, I used to think of Notepad++ a lot more like an IDE than the actual FoxPro IDE inside DOS…

            If you are refering to this kind of text editor, like the recent VSCode, I would still consider them as IDEs.

          • Nutarama

            My second language was FORTRAN, which we did entirely in notepad, not even Notepad++. Then ended up using a slightly fancier text editor to write some code in a proprietary language very similar to FORTRAN. If you’re counting Notepad++ as an IDE, I’d agree much more with your idea. To me, if something’s not labeled as an IDE, then it’s not an IDE.

          • An0nym0usC0ward

            My first code that went on to be compiled and executed (with a runtime error) was FORTRAN written on paper, which then went to card punchers, who created the card stack, which was then fed into the specialized reader. For maybe 30 lines of code (probably less – it was a very long time ago) it then produced several tens of printed pages, on special paper used by dot matrix printers.

          • An0nym0usC0ward

            Or it can be a modern DSL which you/your team created, for a particular project. It’s usually a lot easier to configure syntax highlighting in an editor than in an IDE, which, especially for small files, makes a plain text editor a lot more convenient.

          • anonymous

            for starters:
            – Bloated, resource hog, slow execution
            – Overwhelming installation, dependency tree nightmares
            – Inconsistent availability
            – IDE does the wrong thing – interferes with coding
            – Doesn’t integrate with tools correctly (forcing external compile/debug)

          • John

            Yes. I’ve had to use some IDEs which were not highly configurable. Sometimes its actually better to use vim or emacs, even if you have to write your own extensions to replace missing IDE functionality.

          • An0nym0usC0ward

            To a large extent, those are IDE configuration issues. If you don’t install what you don’t need, IDEs can be quite nimble and either do nothing or do the right thing. Plus, although not as straightforward, they’re as extensible the way you want them as emacs (vi is a bit of a different story, IME).

          • John

            Some people must do a lot of their work on a remote server, and use vim, emacs, or similar over the terminal.

            Others are using less popular languages for which the best working environment is vim or emacs. There may be no IDE, or it may be under developed. Eventually these languages may get high quality IDE support, but until then…

            For other people, they need to pick up a project in a language they’ve not used for many years, make improvements fast, and move on to another project in other language. Sometimes it may be easier and faster for them to use vim/emacs/similar than it is to deal with the unfamiliarity and peculiarities of the IDE which one conventionally uses for that kind of project.

            Related – when I first started creating Android apps, I was _much_ faster in vim than I was in eclipse. I forced myself to learn eclipse (and now intelliJ). But even today – even though I’m very familiar w/ android studio, and use the vim plugin, there are still occasionally special cases where its still better for me to switch to true vim. As awesome as android studio is, there are things it just can’t do efficiently, or at all.

            Also, you can consider the long term benefit of the time invested mastering various tools. I’ve gotten competent at several IDEs only to have them fall out of favor, such as eclipse. Vim/emacs are always there. Languages and IDEs come in and out of fashion, and sometimes evolve quickly. If you are looking at “lifetime skills” which are empowering for decades mastering vim and/or emacs is well worth the effort.

  • Jay

    I’d like to suggest initial coding style education as the compounding variable. Teachers who emphasize good coding style are more likely to emphasize the use of particular spacing (and thus passively suggest using spaces instead of tabs) than teachers who do not emphasize good coding style. Students who had the former teachers will generally have better style, apart from space usage, than students who had the latter teachers. Also, students who had the former teachers are more likely to use spaces than students who had the latter teachers. Students with better style (regardless of space usage) will earn higher salaries, so a correlation between space usage and salary will appear.

    Personally, good coding style was a major emphasis in my first computer science (Java) class. We were taught to use four spaces to indent each line. I started off using spaces, but later switched to tabs. If I need to submit code with spaces, I will write the code with tabs and then Replace All tabs with four (or two or however many) space characters (and increase the file size), or configure my IDE to do this automatically. Other than space usage, I am very persistent on style and will fix the style of code I receive before I read or compile it. Because of my positive style habits, I anticipate that I will be in the “Spaces” category of developers as far as salary goes.

    • GonzoI

      Look at hiring habits, though. Very few companies or even startups use code samples from applicant’s own IDE. Most give practical tests or carelessly don’t check code at all. Despite some idealism about style consistency, most employers just don’t care as long as it meets certain readability requirements such as using the right casing and not exceeding a threshold in a calculated cyclomatic complexity.

      You might be right that it is based on the institution, though. Graduates from well recognized universities or those with good placement programs have a better average salary than others, regardless of the quality of the particular program. If we apply this to IT, some particular program in the past could have spread the “spaces” style mistake to well-placed people, resulting in a lot of well-paid coders who don’t know where the tab key is.

    • Guilherme Taffarel Bergamin

      About fixing the style, I used to do that as well, but I had problems with higher ranks because of that, so now I only do it if I’m going to modify a lot that piece of code… Some companies don’t really care about the readability of code. They just want the code to be delivered because the client is waiting for it.

  • Marco Ko

    My hypothesis: The element of tradition in education plays a role, i.e. the confounding factor is by whom the respondent has been implicitly or explicitly taught.

  • Marco Ko

    My hypothesis: The element of tradition in education plays a role, i.e. the confounding factor is by whom the respondent has been implicitly or explicitly taught. Call it genealogy of mentors. This information can’t be extracted from the available survey, thus it can’t be tested at this point. But I predict that you won’t find any other causation in this data regarding the correlation of spaces/tabs vs. salary.

  • Andrew Maxwell

    But how many of those space devs are required to use spaces because of code style guides at their respective companies? Regardless of whether or not they choose to use spaces on their own.

  • Mike Lemmon

    The position of Go in the language graph raises some questions: +$20k/yr for Go devs who use only spaces!? Code in Go is autoformatted with tabs by convention, and a large majority of open-source golang code is autoformatted with tabs this way. Either there’s a big underground community of highly-paid go devs secretly writing their code with spaces, or — way more likely in my opinion — the data is off and go devs who should have answered “Both” said “Spaces” because that’s what they prefer or what they use in other languages where there’s actually a choice to be made.

    • Cory Long

      Or only very few people answered go and spaces, and so the sample size in that specific case is small.

    • Tim!

      I assume language choice was a multi-select option? Might be interesting to correlate # of languages selected rather than treat each individually. I’m thinking maybe space users are more likely to use multiple languages, and multiple language fluency would correlate with higher compensation for multiple reasons.

    • Throstur T

      Go programmers who “use spaces” can still use spaces even if gofmt uses tabs. It’s as easy as a couple of lines in a .vimrc that should probably already be there to begin with.

      • Peter Williams

        Is having to use vi worth the higher salary?

  • Bill the Lizard

    Clearly employers are paying developers by the byte.

    • Félix Gagnon-Grenier

      Me own bytes go to eleven.

  • Josue Ibarra

    I automated that promotion for those that are interested 😉
    https://gist.github.com/ibarrajo/74a03b135079ee23f3ae0250de11fe4c

  • Mike Darkins

    It’s quite simple, people who use spaces think they’re the best and will happily share their salary etc, whereas Tab users are a lot more modest and rather not share. The 50% of people who didn’t share their income contains all of the higher paid; modest Tab users. And little Space users.

    • Félix Gagnon-Grenier

      … more like, tab users are sour all over the place 😉

      as you may have noticed, the only people resorting to name calling, are name calling the space users.

      Literally none have said stuff like “we’re better”.

    • It’s a very reasonable explanation, supported by the evidence.

  • Matteus Deloge

    Could it just be that the ‘spaces’ method is an older form of code formatting and that older programmers using spaces have the advantage of seniority therefore earning more money? So it’s not that using spaces earns you more money, it’s your seniority that explains a higher salary …

    • David Robinson

      See the first graph; the effect exists within each level of years of experience.

    • Nick

      Dude did you even read the article? Years of experience was literally the FIRST confounding factor that they controlled for.

      • Matteus Deloge

        Totally blew past that, I guess I need to refill my cup of coffee big time. Apologies

        • anonymous

          Years of coding does not necessarily track perfectly with age (e.g. some of the people using spaces could be folks who started coding later in life, or who have spent more years of their career in non-coding positions, especially management), so it could possibly still be a confounding variable

          • John

            That would still rest on the assumption that older developers did not have the tab character available to them. It being part of the original ASCII set, which goes back to the 1960s, so this is so unlikely as to not be worth mentioning.

  • mingos

    It’s not the spaces that make you more money. The best paying companies usually mandate that you should use spaces. The whole spaces and earnings thing is one giant fallacy from the ground up, mixing up the cause and the effect.

    • They mandate it because it facilitates working in a team, and because the people making that call are senior devs who have experienced the pain of mixed tabs/spaces.

      • An0nym0usC0ward

        I don’t think so. IME, they mandate it because furniture police. They could as easily mandate using tabs exclusively for indent – a style checker can warn of mixes on commit. More often than not, very senior developers prefer tabs, not because it adds any stylistic or technical value, not at all because it saves a few bytes on disk, but simply because it makes sense. In a given editor, a tab has always exactly the same width. It happens to me repeatedly that upon code reorganization the IDE mixes up indentation, and unless I want my whole file reformatted (like all javadoc comments messed up) I need to fix this manually. What’s more, a wise man once said that it isn’t typing that slows you down, when coding. Using spaces for indentation is simply a dogma that has caught on among enterprise developers. But it doesn’t really have any advantage over using tabs. Of course, mixing tabs and spaces is plain stupid, but if tabs for indent proponents can do the mix, so can spaces for indent proponents do it.

  • Typing spaces just takes more time, thus per/hour it is more expensive. That simple 😊

    • JadePenguin

      Many editors such as PyCharm do spaces automatically when you hit TAB key

      • John

        Yes. Pretty much _all_ editors and IDEs which any real programmer would use, allow this to be configured.

      • All modern editors do this. Every single one.

    • Félix Gagnon-Grenier

      …. you really think people use the space key to insert the spaces?

      https://stackoverflow.blog/2017/06/15/developers-use-spaces-make-money-use-tabs/#comment-3363700432

      • el.dide

        … you really think this was not a joke ?

        • Félix Gagnon-Grenier

          Yes. Read the comments a bit more. Many people are actually making that assumption, very seriously.

          Though, maybe there are some jokes in there, but judging from the general sourness in the comments of tabs users, I don’t find it hard to think 😉

          … and if it were, I’d still argue it is getting really old, having been made like 30 times already…

    • ryepdx

      I don’t think anyone who uses spaces over tabs types the spaces individually. The IDE does it automatically for you.

      • GonzoI

        If you’re filling out a survey on Stackoverflow, and you are asked if you use “spaces” or “tabs”, are you going to answer based on what key you pressed, or on what your IDE did for you? I would answer “tabs” even if my IDE converts them into spaces. You also would see the effect dramatically decrease when controlling for language as some languages don’t have an IDE that does spacing automatically. This is indeed talking about typed spaces.

        • Félix Gagnon-Grenier

          Of course you’d answer based on what the character actually is in your script, that’s the whole point of the debate. Adaptable tab size does not refer to your keyboard!

          Languages don’t “have” ides. Text editors can edit any text in the world, in any language, and you can control indentation of your text editor.

          • GonzoI

            Considering the comments here, the two of us may be demonstrating the divide. It’s not that we “don’t know the difference” as a certain person put it above, it’s that the question is being presented in a way that some of us think you are (like people we know in the workplace) pressing the space key rapidly every time you want to start a new indention level.

            If it were actually about consistency, tab use and tabstop size would be mandated instead of requiring spaces since you can’t type part of a tab. It isn’t about readability because people configure tabstops how they prefer to read indentation. Take away all the flimsy arguments that don’t actually hold up when you think about them and you’re left with only 1 tradeoff: The benefit of consistently using tab characters is that they adapt to the display preferences of the individual programmer. The benefit of space characters is that tab characters adapting to the display preferences of the individual programmer suddenly look weird when one idiot presses the space character a bunch of times instead of using tab. If we didn’t have people who actually pressed the space bar multiple times, we would all be using tab characters.

          • ozzy

            It won’t matter if you’re only looking at code in the same IDE on the same platform.
            If you use diff/merge tools or a platform like Github where the diffs are shown in a browser, the whitespace formatting becomes a huge issue.

            Always convert tabs to spaces, because you can’t set every tool to use the same tab size.

          • Brian Christensen

            In an exemplification of the eminent flexibility of tabs, this is easily resolved with a .editorconfig file in your repository root, which GitHub will respect when displaying your source files in the browser.

          • Except sometimes you want alignment that isn’t easily achieved using tabs, such as lining up the colons in a dictionary. Then you have to use mixed tabs and spaces, and you will only cause pain for any other developer who tries to edit your work.

        • ryepdx

          I’m going to answer based on what I configured my IDE to do, which is spaces. I specifically set up my IDE to use spaces. It would be utterly braindead to hit the spacebar multiple times at the beginning of each line.

          Anyway, I use Vim most of the time, rather than language-specific IDEs. There are almost always Vim plugins for whatever language I’m using, and if not I still get my preferred formatting.

          • GonzoI

            Umm… “beginning of each line”? I didn’t think even vim required you to do that. Yes, many people do (you can audibly tell when they do, even with “quiet” keyboards) press the spacebar four times to make an indentation. But any modern IDE only requires you to do it once (or tab once) for each layer of indentation you want.

        • Guilherme Taffarel Bergamin

          Gonzol, that is the reason why I think the survey may have been poorly developed. The whole point between tabs or spaces is the character and not the key pressed. Basically there are these two arguments:

          – Tabs consume less bytes and can be rendered in any size you need your indentation to be
          – Spaces let you have more control over indentation in cases when you need a long line of code to be broken in pieces and maintain a nice and tidy read of the code

          • GonzoI

            I’m confused on the second one how that would differ from tabbing. When I break a line of code for readability, I use the same tab-indention that I do for nesting so that it’s consistent and obvious for the next person who reads it. Having varying lengths of tabbing seems like it would be harder to read.

          • Guilherme Taffarel Bergamin

            Gonzol, not varying lengths of tabbing, but varying number of spaces when you break a long line, for example a long if statement consisted of many “ors” and “ands” with parenthesis and so on, or when you want your String look in the code the way it will appear on the screen when running

          • Ext3h

            [code]char *foo = (
            “In”
            “Don’tn”
            “Seen”
            “Yourn”
            “Problem”
            );[/code]

            If ever something inside a pair of parenthesis needs to be broken into multiple lines, just break everything instead. If you would need to break and there are no parenthesis yet, just add them.

          • Ext3h

            I prefer to use a brace style which does never need alignment on keywords identifiers. So if you need to break an argument list, everything gets on a new line, and then is just indented with tabs, no side effects.

            If the style guide does not permit that, indent with tabs according to the current indentation level, and then use spaces to match the length of the non-tab characters in the previous line.

            Both renders nicely regardless of the configured tab width.

          • GonzoI

            Are you saying to tab/space to match the placement of the brace in the first line? In older styles, I could see that, but now that most are going to names that “self-document”, that’s too deep for tabbing.

            So we’re not talking across each other, my thinking is:

            Employee.Address.CreateNewAddress( city, state, zipcode,
                 streetaddressline1, streetaddressline2)

            If I understood what you were saying about matching the length of non-tab characters in the previous line, you’d run into problems with:

            Employee.Address.CreateNewAddress( city, state, zipcode,
                                                                            streetaddressline1,
                                                                            streetaddressline2)

            EDIT: Forgot that I’m on the internet where spaces aren’t rendered…

          • Ext3h

            If you need to break one, then break all.

            Employee.Address.CreateNewAddress(
            t city, state, zipcode,
            t streetaddressline1,
            t streetaddressline2
            )

            Yes, that is two more lines, but the indentation is unambiguous. Also non of the lines is even remotely approaching the length limit.

            So much for my preferred style.

            For the other option, the additional indentation to match the parenthesis only with spaces. In front of the spaces all the tabs used on the parent line. So effectively:

            ttt Employee.Address.CreateNewAddress( city, state, zipcode,
            ttt ………………………………………………………streetaddressline1,
            ttt ………………………………………………………streetaddressline2)

            That fits the appearance which many of these “manual space artists” try to achieve, while still correctly behaving with different personal preferences on tab width.

        • Nick Brown

          So then the findings are that developers who are familiar enough with their editor to know what is output when they hit the tab key make more than developers who aren’t.

          • GonzoI

            Could you stop with the “them dumb, I smart” garbage? Everyone knows what their editor is outputting. Even if they don’t delve into the IDE configuration, the first time they backspace over a “tab” they learn whether it’s replacing them with spaces or not.

          • Nick Brown

            Apparently not considering the number of people saying spaces are slower.
            And it’s not a question of dumb vs smart, it’s a question of knowledge or ignorance of things like tooling and issues surrounding maintaining applications worked on by large teams. Someone who hasn’t worked on a large codebase that has existed through several generations of developers may not care about mixed spacing because they’ve never encountered that pain. And I would expect people without that experience to not be pulling as high of a salary.

          • GonzoI

            How does “people saying spaces are slower” conflict with what I said? People making that comment clearly believe the question has to do with what key is being struck, not what the IDE is producing. And we’re not saying it as a hypothetical “somebody out there might be typing spaces”, but from actual experience of having coworkers who, when they wanted to indent, rapidspaced. The slightly more hollow sound of the spacebar hit hard with the knuckle of a thumb several times in rapid succession is easy to tell apart from normal typing. There are also a lot that I’ve seen over the years who drop their whole hand down and four-finger the spacebar to get their line spacing.

            I have worked with a codebase that’s older than me. I’ve also worked with code that had a mixture of spacing and tabbing in an IDE that didn’t convert tabs to spaces, and the only issue was the people who used an inconsistent number of spaces making their part of the code hard to read. If your spacing is consistent (which, frankly, it should be), then you can change between tabs and spaces arbitrarily with no significant effort. Just mass replace t with however many spaces you want and you’re in your space paradise. Just mass replace however many spaces your tabstop is set to with t and you’re in tab paradise. If you’ve got large blocks of inline text in the code that might be affected by tab/space differences, you need to fix that anyway so do it before the mass replace. The problem of arcane legacy code is the changing coding conventions of the past developers, not whether they used spaces or tabs.

          • Nick Brown

            I doubt that is too common (I have my caps lock key mapped to control, I don’t describe keystrokes using that key as using caps lock), but to the degree that it is, developers who see the question as one on which key they are pressing and not what character is in the code are also, by definition, less knowledgeable on maintaining code bases. It makes sense they would on average be paid less.

          • This is true until you hit version control, where tabs and spaces are taken into account by default. Fine if you don’t care about Github.

          • Exactly this. Mixed tabs and spaces cause version control issues, and create non-obvious, and impolite indentation issues when multiple devs work on files that contain them.

            I would expect people that don’t know this to earn less.

          • k

            Except that backspace goes back over whole indentation level regardless if it’s replaced with spaces or not. But yeah, I would be surprised if anyone didn’t knew what their editor is doing at such basic level.

          • GonzoI

            In every IDE I use, shift-tab goes back an indentation level while backspace removes the previous character. What IDE are you using that overrides backspace to indention level?

            And again, drop the “them dumb, I smart” garbage. You are being intentionally condescending when you say things like “I would be surprised if anyone didn’t knew what their editor is doing at such basic level” and that behavior only devolves conversations towards a childish slap-fight.

        • > This is indeed talking about typed spaces.

          No, it isn’t. Experienced developers don’t think about the key they pressed, but the characters that end up in the text file. I have all manner of shortcuts.

          The difference in salary here might correlate to developers who understand their tools, vs. developers who don’t.

    • BlueNinjaSmurf

      Configure your editor right and there is no extra time. Also, spaces maintain consistent visual styling across development tools.

  • Colz

    You’re missing a variable prob

    • David Robinson

      Code and data are here, try it out! https://github.com/dgrtwo/tabs-spaces-post

      • And, dare I say it?, have a look at the `tab_space_survey` function in the sample code in `README.md` and consider the effect of tabs vs. spaces on that.

        • David Robinson

          tab_space_survey is an object, not a function. I’m not sure what you’re referring to?

          • Sorry, I don’t know R and I didn’t read too closely. Whatever that thing is on the line starting tab_space_survey through the line starting filter(Professional.... (I am moderately sure that what one calls it makes no difference to how using tabs at various tabstops vs. spaces would change the indentation of it.)

  • Arnold Spence

    Use an IDE that will display code formatted however you want it and save it formatted according to whatever code style convention is in place. Or use a pre-commit hook to format it. Arguing over tabs vs. spaces seems like a waste of energy.

    • Nikhil Sahu

      Finally someone said it.

    • But then, if I fork it, and my editor changes the formatting, the merge will overwrite random bits of code all over. It’s only a waste of energy if source control treats it as non-semantic, and Git currently doesn’t.

  • Ralf Kleberhoff

    Depending on the editor used, tabs get expanded into 4 or 8 spaces (typically). So, tab-indented source code often shows up with unintented indentation – really ugly.
    Maybe, a developer who doesn’t know or care about that fact simply doesn’t achieve the same reputation as another one who knows and cares.

  • Kevin Norris

    > So… this is certainly a surprising result, one that I didn’t expect to find when I started exploring the data.

    I really wanted to be the killjoy who says “you can’t just [play around with your data until you find a result you like][1],” but…

    [1]: https://en.wikipedia.org/wiki/Data_dredging

    > p-value 10^-10, so this is **still a significant result** even under highly pessimistic assumptions. That’s actually very surprising: You did sloppy statistical analysis and still managed to get a “good” result.

    [2]: https://en.wikipedia.org/wiki/Bonferroni_correction

    • David Robinson

      I’m aware of the statistical challenges of multiple hypothesis testing, and I’ve done mathematical research on the topic (check it out in Chapter 5 of my dissertation: http://arks.princeton.edu/ark:/88435/dsp01hd76s238c ). But I just said I hadn’t expected to find this result, not that this wasn’t the first thing I checked.

      As it happens, I was interested in writing a blog post on tabs and spaces, and after first measuring the percentage using tabs/spaces/both the first hypothesis I tested was the salary difference. (Wouldn’t you?)

      • Kevin Norris

        I made pessimistic assumptions in order to demonstrate the robustness of your result, not to criticize it.

        • David Robinson

          Sure, but you did call it sloppy 😉

      • Guilherme Taffarel Bergamin

        I wouldn’t because that doesn’t make logical sense… But as an interesting clickbait, it makes a lot of sense. Most people clicked it even knowing it is a clickbait and that is where you win. Good job.

        • let’s be rational

          your cynicism runs deep.

          • Guilherme Taffarel Bergamin

            No, I’m being truthful. Seriously. I would never try to correlate space/tab with salary because it doesn’t make sense for me, but I see things way too logic and that is my personal defect. I really wish I could have this kind of business ideas like “I’ll make an article about this very polemic topic, so I will have more clicks”.

          • let’s be rational

            clickbait or no, the math is solid. and the author’s defense of their motivations holds up. was it published because publishers see it as clickbait or because the author intended it that way? chances are it’s an honest article with its placement decided by appeal. but your defensiveness and readiness to attack motivations lead me to believe you disagree with its conclusions, or at least are cynical enough to question the motivations of the author — which is why i mentioned it.

          • Guilherme Taffarel Bergamin

            Maybe I was too harsh in using the word clickbait, but the thing is that it was an interesting marketing move to connect salary with some specific polemic topic.

            The math is as solid as saying that people are allergic to hanging (as in “most people die when in contact with it, so people must be allergic to it”).

            Let’s say, I agree with the conclusion (correlation != causation), but the article itself is not informative. It doesn’t add anything. It doesn’t give you more knowledge. But it is a smart way to promote the survey itself. For instance, I didn’t know Stack Overflow does this kind of surveys and I would like to be part of it in the future.

          • John

            What is illogical about it?

          • Guilherme Taffarel Bergamin

            Because it is assuming your typing habits could influence how much you earn. The real reason why the survey got this result is certainly not the tabs/spaces. If you want to know the real reason behind this, you should isolate the money variable and start checking everything else. You may find a pattern like other people said with examples like “big companies favour spaces and big companies pay better”

          • Guilherme Taffarel Bergamin

            You tell me why relate money to a typing behaviour is logical. It is not logical. It is marketing. The only logic applied here was that it is an obvious bait for people to click in the article and comment about it. And yes, I was caught by it hehehe

  • Baris Ozkuslar

    I think the reason is that many people don’t understand the question. Because many people are just using tabs, and they are not aware of the fact that tabs can be composed from tab characters vs space characters. They will probably think like this: “Of course I use tabs, who would press space repeatedly instead of using tabs”

    So, I split people into four groups:

    1. People who uses tabs, and know about spaces/tabs topic.
    2. People who uses tabs, and don’t know about spaces/tabs topic.
    3. People who uses spaces, and know about spaces/tabs topic.
    4. People who uses spaces, and don’t about spaces/tabs topic.

    I expect groups 1, 2, 4 to answer tabs. Because of not knowledgeable people in group 4, since we can assume not having knowledge about an arbitrary topic statistically decreases the expected wage, tab answer will have a lower average wage.

    • Bryan Oakley

      “tabs can be composed from tab characters vs space characters. ”

      No, tabs are composed of tabs. The tab _key_ can insert tabs or spaces, but a tab is a tab. It’s not “composed” of anything. When someone asks “do you use spaces or tabs” they aren’t asking what key you hit. They are asking what is in your file.

  • Ritesh Rituraj Nayak

    As @chipoverclock:disqus remarked before me, tabs have to be rendered, spaces do not. The length of a tab varies across platforms – I’ve seen it rendered as 2 spaces, 4 spaces and 8 spaces in my life time. This one time I beautifully formatted code in my IDE with tabs, which were the width of 4 spaces in my system. As soon as I uploaded it on gerrit, its ugliness was pointed out to me and I soon realised that because gerrit was rendering tabs as 8 spaces, none of my secondary indentation had any effect anymore. I’ve since learnt 2 things
    1. Do not use tabs to separate pieces of code horizontally to a specific amount.
    2. Do not spend time making cosmetic changes when the right IDE plugin/package can do it for you on the fly as you type.

    I guess people who have abandoned tabs are the ones who were quicker to realise this than their counterparts in the same experience bracket.

    • Stella Orion

      Will you marry me?

      • Ritesh Rituraj Nayak

        I’d love to!

        • Stella Orion

          Just for the people reading this, he did not just say yes to a random stranger: I am not a troll, I am his girlfriend. XD

    • Dylan James Wagner

      Leading whitespace tabs, internal line whitespace spaces, this keeps your formatting and allows your editor to size the tabs how ever it is configured.

      • And is a complete PITA for anyone else to work on ever. Only do this if you live in a silo, and have no Github account.

        • Dylan James Wagner

          Not with an .editorconfig and a style guide. Every project has its own requirements, this is just one of those. Some projects may use tabs and some projects spaces, being able to manage either is more important. If I had to choose it would be leading tabs, allowing display choice for each developer.

      • It doesn’t keep your formatting. If I have a multi-line comment to the right of two lines of code (i.e., the code lines are to the left of the comment lines, sharing the same lines), the start of the comments will line up for only one setting of tab indent. (Not to mention the PITA of changing your tab stops on all your different tools. I don’t even know how to change it on GitHub.)

        • Francesco

          Thou shall not have a multiline comment to the right of lines of code. 🙂 That is the source of all evil indentation problems. Keep your comments either single line or above/below code. Or stop all this commenting trend, let the code speak by itself in freedom and glory! 🙂

          If you follow these rules, you will be able to:
          – use tabs or spaces and nobody would care
          – change tab size as you like, for better reading without beeaking indentation
          – convert tabs to spaces and viceversa without problems

          Jokes apart, code should be formatted in such a way that it really would not matter even if you edited it with non-fixed size fonts.

          • While I agree with you that writing code that’s so clear it doesn’t need comments is always the first thing you should try to do, not all code can be like this. As for where they go, comments should go where they make the code most readable. Making readability a second priority to solving technical issues that arise because you want to use tabs instead of spaces is utterly misguided, IMHO.

          • Francesco

            Yes, I was really joking when I said “do not comment”, but really, writing clear comments with one simple principle (no multiline comments to the right of code) is a good habit, and I do that even when I use spaces and not TABs. I don’t like to count on monospaced fonts either and not to be able to convert my code to TABs eventually. Portable code is code that “could” use tabs, if needed.

            Code can be pasted in places you didn’t plan and edited on editors you wouldn’t imagine (like an html textarea or even facebook, ugh!). Sincerely I think that someone that uses spaces because are more portable should comment in a portable way too.

            And then he can revert to TABs because then there is no portability issue any more 😀 (joking here)

          • You claim you’re joking, but actually you’re not. That’s the issue with junior programmers: they think that there are rules that always apply. And usually the main thing driving them to this mistaken idea is their lack of experience.

            I just picked the second page from a search result for “assembly language” and got this, and you’re claiming that turning that 15 lines into 26 lines where you can’t see the “does this” right beside the instruction is a better thing. Well, have fun with that. (But, of course, feel free to show us any assembly code you’ve written in the last five decades, or ever, that show us how it should be done.)

            You need to get to level four (“proficient”) and realize that there are no hard-and-fast rules (especially of the type you endorse), and then you’ll be able to have a competent opinion on tabs vs. spaces.

          • Francesco

            Hey man, relax, chill out, if I say I’m joking, I’m really joking. Seriously nobody sane would write on an SO related blog post “Guys do not comment code” :D. At least there is no minus button here! I agree with you that there are no fixed rules and I totally agree with you that assembly does require this kind of commenting, and yes, no tabs there. Any language is different actually, I’m pretty sure also COBOL would be much better with spaces (please forgive me, I like this kind of humour). For the remaining 99.9% of programmers that write in procedural language… no really you are right, there is no fixed rule. Rules like “Don’t write comments like this” or like “Don’t use TABs”… stupid rules. You go on with your comments and spaces, I will keep my TABs, and comment my way that doesn’t break up when you use my code on your editor.

            Anyway your point is clear and you are 100% right, I hope mine is clearer too now (“Do not enforce rules on me as long as my code doesn’t jam on your editor”?).

            And thank you for calling me a junior, that didn’t happen for quite a long time, I really feel younger now. Haha maybe I’ll go grab my ZX-81 and put up some ’80s music now.
            Peace and love.

        • Dylan James Wagner

          Tabs as leading white space only, all other alignment spaces. Tabs stops don’t exist because there is only tab indent. Most editors allow you to set how wide a tab is, 2, 4, 8. Multi line comments by definition would span multiple lines and therefore couldn’t have code to the left for any line after the first. Any thing else would be multiple lines with single line comments.

          • Tab stops always exist: what you refer to as “how wide a tab is” refers to the tab stop settings. Tabs being “4 wide” means tab stops at columns 5, 9, 13, …. Note that the tabs are not a fixed width themselves; with a tab stop at column 5, a tab character in column three is replaced by two spaces when rendered in a fixed font, whereas a tab character at column 2 is replaced by three spaces.

            And therein lies the issue. Consider two lines:
            Two tabs, two printing characters, six spaces, two printing characters
            Three tabs, two printing characters, two spaces, two printing characters

            With tab stops set at every fourth column, the second set of printing characters lines up on column 17. With tab stops set at every second column, the second set of printing characters starts at column 13 on the first line and column 11 on the second line.

          • Dylan James Wagner

            In your example I see where adjusting tab width could misalign items, but your example is trying to align internal line items across two lines that have different leading whitespace indents. This seems like arbitrary alignment and ignores the natural grouping that the indent suggests, where I believe only aligning items within their indent groups is reasonable to support.

            You could change the third tab on the second line to spaces, which in itself suggests it is being aligned to the first line, I do this sometimes, however, I can see an issue where tools that modify leading whitespace from tabs to spaces or spaces to tabs might modify those spaces as well if they happen to match the current tab width.

          • “[I] could change the third tab on the second line to spaces,” yes, thus breaking the rule you explicitly made above (“Leading whitespace tabs”) and also breaking, I assume, your implicit rule that one should use tabs for the indentation used to indicate code blocks.

            In the end, I can always find examples of good, clear formatting that breaks tab users unless they all agree to use the same tabstops, in which case what’s the point of using tabs, since that can only break things (when users don’t use the agreed-on tabstops), never help?

            Tab-users defend themselves by saying, essentially, “live with formatting it more poorly,” though usually that’s couched in terms of “you must follow these rules” (implicitly even if it makes the formatting less clear). I suppose that’s one approach, but in areas I understand well I understand the purpose of the rules and aim to achieve that purpose, rather than aim to follow the rules.

  • GonzoI

    As long as we’re coming up with ridiculous theories based on huge, self-serving assumptions, I’ll throw one out too. Maybe it’s that tab users aren’t as worried about minutia and seek a better work-life-balance rather than higher pay.

    • let’s be rational

      or are lazy.

  • Maxxon

    Ahhh, but did you think that those ppl who use spaces are more likely to lie? 😉 😀

  • Will

    The comments that talk about the “waste” in repeatedly hitting the space key are a clue to the answer. I suspect there’s also a correlation between high pay and developers savvy enough to use a text editor sophisticated enough to require exactly the same number of keystrokes to indent using either tabs or spaces.

    • Yes. Low paid devs don’t understand their tools.

    • Laurent

      Don’t think i’ve ever used a text editor that didn’t automatically handle indentation, except maybe notepad. Are you saying that those (apparently) incompetent programmers who use tabs are all developing under notepad?

  • cb75075

    Its also directly correlating with shark attacks.

    • Xoly

      Not even attacks – just correlates directly with sharks.

  • Axel Heider

    So, now we need this correlated with Vi vs. Emacs…

  • Brett Davis

    WHAT IF PEOPLE WHO USE SPACES ARE PAID BY THE HOUR AND TAKE LONGER TO TYPE STUFF?

    • *meanwhile in normal editor/ide* [tab] -> 2 spaces so doesnt matter. 😀
      Using notepad can take more time.

  • handleym

    “The model estimated that using spaces instead of tabs leads to a 8.6% higher salary”
    This is an exceptionally silly way to present the finding…

    The finding itself is, IMHO, not surprising.

    *Using spaces gives one finer control over exactly how one’s code is laid out and formatted; and people who care about that sort of detail are people who care about other details, and so make better programmers.*

    I suspect you’d find the same sort of correlation if you tested for “number of spelling or grammatical errors per 1000 lines of code” vs salary. (Though that one’s a little tougher to test well because of people programming outside their native language.)

    But the causality doesn’t run the other way. Just switching to spaces (while still not giving a damn about either EXACTLY how your code is laid our or EXACTLY how it behaves) isn’t going to make you a better programmer.

    • Laurent

      Wow that’s something incredibly pretentious to say, over something that’s essentially a matter of taste. There’s plenty of well formatted code out there that uses tabs, and likewise plenty of rubbish one that uses spaces, it’s completely unrelated to the quality of code

      • You misunderstand what he’s saying. He says straight out that code does not become better by using spaces nor worse by using tabs. The point is that better code is more likely to have been written by fussy rather than non-fussy developers, and fussy developers also prefer tabs over spaces, so you’re likely to see the two together.

      • Indeed

      • Andy

        You’re making a straw man argument… exactly the kind of logical fallacy a tabs programmers make all the time… 🙂

  • Lex Irons

    I prefer spaces over tabs. Most editors convert the Tab to spaces, so developers basically indent pressing the Tab, but that just creates e.g. 4 spaces. No one is bashing the spacebar. So if I was asked what do I use – spaces or Tabs I would be confused, and I guess a lot of people did answer spaces (because the end result is space indented) but they do use tab to do it.

    • Abi Gail

      There are still people who manually indent?

      For over two decades, I’ve been using editors which know when to indent. Or de-indent.

      • Guilherme Taffarel Bergamin

        That’s why I think the survey is about the character you are commiting to your versioning system and not which key you actually press. even more because you don’t really need to press any key most of the time. You hit enter and it will go to the right level. close braces, it goes to the right level again and if it gets messy, you still have a command to tidy up your code.

      • “There are still people who manually indent?”

        Apparently so, otherwise (a) there wouldn’t be people who set tabstops to something other than 8 and (b) this almost as annoying as emacs vs. vi (vs effing vim these days) argument about whether tabs or spaces are better.

  • Operating Thetan

    Have fun with your Makefiles then.

    • Stijn van Drongelen

      If you’re willing to use backslashes and semicolons, Makefiles work fine without tabs.

    • A

      My vim automatically inserts tabs if I’m editing a Makefile, otherwise tab is 4 spaces.

      • Operating Thetan

        I don’t use Vim. I use a modern IDE that does the same but without the feeling of living in the 80’s.

    • Andy

      You got me. I get paid more than you to write code I don’t know how to build…

    • Bryan Oakley

      I think any language that requires tabs is not part of the discussion. In the case of Makefiles, tabs aren’t just for formatting, they have a semantic meaning.

      • Operating Thetan

        It seemed obvious to me that I was making a joke and that everyone would understand it.

        • Bryan Oakley

          tabs vs spaces is not a joking matter. This is serious stuff! 🙂

          • Operating Thetan

            People are at war because of Vim vs Emacs! 🙂

          • Bryan Oakley

            All I can say is, when deciding about tabs vs spaces, THINK OF THE CHILDREN!

  • Morgan Grobin

    Wow, I never knew that the whole spaces/tabs debate was simply a misunderstanding between the two groups. As an EE student/hobbyist programmer, I legitimately thought that people who used spaces actually pressed space 4 times to achieve that. Based on these comments, it seems like the tab camp is arguing “Pressing the tab key is easier!” and the space camp is arguing “But spaces make for more consistent formatting (and we also press the tab key!)” Without discussing their underlying assumptions.

    It seems to me that people who continue to press the tab key for efficiency’s sake, but also go out of their way to update their .vimrc or IDE settings to change the tab key to spaces for formatting consistency, are the kinds of people who would take more initiative in projects, be more thorough in their research, and simply have more random knowledge – all traits that would be rewarded with promotion and salary increases.

    • Guilherme Taffarel Bergamin

      That’s it, Morgan. Even though the higher salary didn’t arrive my pocket yet hehehehe

      • Robert Lee Louviere

        Or it did and you’re base value is lower than you thought…. 😛

        • Guilherme Taffarel Bergamin

          I can agree with the base value for a programmer here being low (South of Brazil), but if I’m above it, I’m sure it is not much hehehe usually the local companies don’t reward programmers for being good. They reward the sellers who could sell a product that is still not finished and then make us do extra work because the product was already sold.

          • let’s be rational

            amen to that, across all walks

    • let’s be rational

      spot on. reflects my thinking exactly.

    • Yes. This is it. Anyone who knows their tools pretty quickly figures out how to make tab insert two spaces. Anyone who operates in a team pretty quickly figures out that tabs help other people to read their code, and cause fewer issues with source control.

      These are qualities of high functioning developers.

      • Nutarama

        Yeah, but that knowledge is generally due to somebody pointing it out and then going looking for it. Most editors don’t have that as an easily accessible setting, and most people don’t just go looking at settings pages for fun.

        Also, if you’ve ever worked on a team you know how useful comments can be, but good code commenting is still pretty rare in the industry as a whole.

        • > that knowledge is generally due to somebody pointing it out

          Yes, I remember when it was first pointed out to me. The fact I was, and continue to be, in environments where I learn these things probably (at least for me) correlates to the direction of my career.

      • Bryan Oakley

        “Anyone who operates in a team pretty quickly figures out that tabs help other people to read their code, and cause fewer issues with source control.”

        My experience is exactly the opposite. I’ve never worked on a team that used tabs that didn’t have readability issues between different people, unless everyone agreed to the same tab width.

    • cageordie

      What make you think people don’t know exactly how their editor works, and exactly how the file is stored? Tabs are variable when viewed with other editors. Almost every place I have worked in the last 30 years has forbidden their use. I have a variety of rc and config files that I use to customize whatever editor a customer or employer uses. The one place that insisted on tabs failed.

      • Morgan Grobin

        If you look at the rest of the comments on this article, most of the ones that talk about preferring tabs say something to the effect of “The reason I use tabs is because I’d rather hit tab once than hit space four times.” The ones talking about the number of bits a character takes up are the ones who also use spaces.

        This reads to me as if the people using tabs, in fact, don’t know exactly how their editor works and how the file is stored.

        • cageordie

          I’d like that not to be true. *sigh* But I’ve been doing this long enough to have met a lot of idiots. OK, you win.

    • jonatown

      Most of the time I don’t even use tab. My editor indents my code automatically. I only need to use backspace to delete indentation. And there is the problem with spaces – with tabs you only need to press backspace once in most editors and it just works. With spaces… you have to click-click-click-click… and count the clicks so that you don’t end up with indentation that’s not divisible by 4 in my case.

    • Robin Munn

      I just got through reading this thread, and I don’t see what you’re seeing about “most” of the tab-preferring responses being confused people who think the key, not the character, is being discussed. You’re quite right that there are some confused people in this thread, but most of the tab-preferring responses I saw were people who perfectly understood that it’s the character being discussed (any response that talks about “But tabs let you set the indentation level that you prefer” is talking about the character).

      It’s not a misunderstanding on most people’s part. There’s a genuine disagreement over which character leads to better / more readable code. And it’s a debate that has been going on for YEARS.

    • beets

      :+1:

  • Roman

    I use the space key, but I have my IDE configured so that it inserts ⅛ of a tab character.

    • Beautiful.

    • KlingOn2K

      Since you’re thinking ‘tab’ even though you use space, your boss will think about giving you a raise but will not in the end.

    • This is just terrible. Clearly you should have it configured to insert ¼ of a tab!

  • Robert Lee Louviere

    Did you check age? Salary may be different because one style was popular at a different point in history, so a different generation adopted it.

    • Guilherme Taffarel Bergamin

      Elder people tend to earn more. It makes sense.

    • gavingreenwalt

      I would think job experience would catch that.

      • Guilherme Taffarel Bergamin

        Age is unfortunately more credited than actual experience

  • let’s be rational

    i don’t think there’s a rational argument for keeping your base files indented with actual tab characters. thankfully most IDEs at this point afford you the option — yes i use the tab key (or more accurately my IDE indents appropriately for me based on context in most cases) but the resulting files are indented with spaces. If you’ve ever had to edit a file with mixed tab and space indenting that made sense in the context of the author’s environment but was totally messy in any other, you’ve probably come to the same conclusion — spaces are the only non-equivocal answer. it’s been a no-brainer for years now.

    • Laurent

      You’re comparing spaces vs spaces mixed with tabs, not the same thing.

      • Indentation is broken in both mixed tabs and only tabs in this case.

    • RaymondMoul

      Tabs for indentation of code blocks are great because you can set your tab width easily in just about every editor (even ones that don’t have tab to space conversion features), and so everyone can choose a tab width setting that works great for them (mine is equal to 3 spaces). If you need to further align code (like lining up equal signs) you would just use spaces here, no tabs or mixture of tabs and spaces. This way the code will always carry both the indentation and further alignment properly between editors, and has the added benefits of user defined tab widths and slightly smaller file sizes.

      • The “further alignment” may or may not work properly depending on what you’re aligning and where. Code blocks unfortunately lose spaces in Disqus, but in your editor try:

        if something# A long explanation
        other thing# on these lines.

        and note that the comment aligns only with 4-column indents, not with 2-column or 8-column indents.

        • Yup. This.

        • Francesco

          Don’t do that. Mixing TABs ans spaces. I use TABs, and my comments are either single line or stay below or above. Multiline side comments are totally ugly! And *those* break indenting, if you change TAB size, not the TABs themselves.

          • Bryan Oakley

            Telling a team of programmers not to do something that comes very naturally and is done by almost every programmer isn’t a particularly good solution.

          • Francesco

            Like telling them “Don’t use TABs”?
            🙂
            No, right, that’s done by only 50% of them (and the poorer ones, it seems), so alright!

  • Eihab Khan

    Richard Hendriks needs to see this!

  • I think this is super mario’s fault, he put value on the spacebar with coins.

    • James Clark

      Wha? Mario jumps with the A button

  • curtis

    I just found out that Mr John Daring Fireball uses tabs and that just makes me seriously happy that I use spaces.

  • Rodrigo Carvalheira

    intellij saves tabs as spaces… the data is not accurate…

    • Tez K

      This is possible in eclipse as well. It is just a setting on usability and the actual.

    • Bryan Oakley

      I think you misunderstand the question. The question isn’t about which key you hit in the IDE to indent, the question is about what character is in the file on disk.

      Pretty much all IDEs and editors are configurable in this way.

      • Rodrigo Carvalheira

        Yes, I did understand that… the problem is knowing the default… and if it’s configurable what kind of data does this produce? imagine that only 10% of the developers actually change this setting then all the data here is actually 90% wrong or not accurate.
        Been thinking, and the thing is that I’m also confusing this survey with an “old” news like this but that went through all the github code and there almost all of the code was using spaces… which indicates that the default on the IDEs is to save with spaces but yes, given that this is a survey on developers it might be right. sorry for the confusion…

  • Thomas Williams

    As far as I can see tabs use one character code wheras 4 spaces use 4. So a tabbed file will be much smaller than a non tabbed file, so tabs rule.

    • Quaid Ferguson

      Is this a joke? How far are you indenting your code?

      • Nutarama

        If you’re in a language like Java and properly indenting, it’s pretty easy to have large blocks of code three indents deep. You can have blocks of code be much deeper than that (I once had a for loop end up seven indents deep).

        • Quaid Ferguson

          So we’re talking up to 21 extra characters per line. Tops. Is that significant to anybody?

    • If you typed code all day, every day, for ten years, you might save a couple of megabytes by using tabs over spaces. Text files are not that large compared to say, image files, or video files.

      • Thomas Williams

        I have been coding for years but I find it easier to press the tab key rather than the space key four times. I don’t think there is an option in dreamweaver to turn tabs into spaces anyway.

  • Chris Barber

    You have to pay people more money to use garbage indentation formatting. Makes sense to me

    • Robin Munn

      While I vastly prefer spaces because of the reasons that many other people have mentioned in this discussion thread, your comment made me grin, so have a +1.

  • a r tompkins

    like my views on sports, music, religion, politics, and every other subject where there can be more than one opinion, which it turns out is everything, I find myself in the minority on this one too. 🙁

  • I can’t speak for anyone else, but the main reason I’ve used spaces is because I finally got tired of opening files in different editors/viewers/etc., and seeing everything spaced out in some crazy way. I didn’t want to spend the time setting “how wide is a tab when using $thing” for every single program I opened.

    Spaces look the same size (with a fixed-width font) no matter what program or page you view the code on. I don’t like surprises.

    • Quaid Ferguson

      This exactly. There is no standard tab width, which causes all of your carefully aligned code to look horrible if it is using both tabs and spaces. Tabs were invented to try to trim a few characters for files sent over the phone line. Not relevant anymore.

      • Victor Stafusa

        In fact, tabs were originally invented for typewriters and ported to computer keyboards later.

      • An0nym0usC0ward

        Someone using tabs for indent will never mix tabs and spaces. Just like someone using spaces for indent will never mix tabs and spaces. That’s a false argument.

        • Quaid Ferguson

          “Someone using tabs for indent will never mix tabs and spaces.”
          Except they do. All the time. And it is a constant source of frustration for people who want to be able to read the pull request but everything is out of alignment.

          • An0nym0usC0ward

            I’ve worked on countless projects using tabs for indentation. Haven’t seen such mix in many. It happened only in projects where other problems were even bigger, i.e. when working with young, inexperienced and unskilled programmers. In such teams, spaces vs tabs are the least of your concerns.

            Usually it’s a matter of setting your preference in the editor/IDE settings once, and then never worry about it again. If you manually type each space, if your preferences say tabs for indentation, the spaces will be replaced with tabs in save. The mix only happens if your indent is already wrong.

            You got me thinking about a particular situation, however, where tabs are indeed capable to get you to mix tabs and spaces – when your coding style prescribes ASCII art. Say your coding standard says that when you break up long parameter lists you have to align the second and subsequent lines of parameters to after the opening parenthesis of the method declaration. That’s ASCII art. If you now do a refactoring and rename the method in an interface, alignment/indentation will be messed up in every class implementing that method. That’s one more reason to use tabs: you can’t prescribe ASCII art when tabs are mandatory for indentation, and have to come up with a coding style where formatting doesn’t need to change when you rename things.

  • Tez K

    This makes sense. People who do not use spaces predominantly give a clue that they have used various tools to read the code and admit that a tab in code makes the code look bad. How bad and when? Going off the indentation, lengthy lines, different display in each OS/IDE/Editor. This means that they have used multiple tools in different environments is which is not just years of experience but exposure and adaptability to many tools. Such developers care about the code being written. It can be the perfection about the code that is maintainable, the code that is concise and expressive, the code to use nice design patterns or anything that will help manage well. When one goes an extra mile about not just working code but manageable code, it also means that they are better ones than their counterparts with similar experience who just write some code but not love code. The love part here is what makes more money.

    • I’m a perfectionist in code quality and I do use tabs

      • Tez K

        I wonder in today’s world if someone considers themselves a perfectionist. Not to humiliate but true. You should have used a better word.

        • I agree that word perfectionist lost its solely positive meaning and now days has more negative tone than positive. It’s just was the first what came to my mind. It would be better to say that I consistently drive for consistency in the sake of code quality as well its maintenability, readability and supportability. Also I use tabs. The latter doesn’t contradict the former.

          • Bart Van Leeuwen

            The concept of the last percent of perfection being excessively expensive compared to the first 99% of getting there has been known for a very very long time, and being a perfectionist has always had the connotation of wasting effort as well as trying to get everything right, its usually age, experience and environment and the specifics of the situation in which the word is used which make that either ‘positive’ or ‘negative’ connotation becomes more prominent.

    • jonatown

      I can tell from experience that space-lovers don’t really care about the code. They often write spaghetti, they don’t adhere to a single coding style and they don’t care if they indented their code by 3 spaces instead of four… by mistake.

      • Bryan Oakley

        I beg to differ. I think devs who use spaces are more about the code looking good for everyone, rather than just looking good for the original developer.

        • jonatown

          I don’t think so. I’ve seen at three groups of developers doing so, in three different companies, writing completely different types of software, in various languages. And I have a lot of experience. I’d rather assume that those “space-guys” here love to give the whole group a lot of credit, where they often really just use what’s editor’s default. 😉

          I can surely agree, though, that there are developers who use spaces because they care about the code.

      • Bart Van Leeuwen

        That merely suggest you need a lot more experience with different people in different environments.

        If what you state was consistently true, it would very likely offset the odd correlation the article is about.

  • What if it’s related to nerdiness (and through that social skills), unwillingness to compromise and thus being worse at (or in a worse position) negotiating the salary?

    Or, I don’t remember what the original survey said, but if there are more space guys then tab guys, then the space guys might just oppress the tab guys (space tech leads offering lower salary, space leads/peers giving worse reviews, etc.). Which they may not even notice, just somehow observe the tab guys as worse or more problematic developers in general. (After all, this has been a very good reason to start a flame war any time for quite a while 🙂 )

  • Spencer Shanson

    Now that the Tab v Space argument has been sorted out, what’s it going to take to make everyone realize that 4 space indenting is better than 2?

    • Christian Gollhardt

      Haha, How about 3? 😛

    • Around the same time people stop writing the forty-line-long `if` blocks that make two-space indentation a truly serious barrier to reading the code rather than a mere annoyance. (That would be “never.”)

    • Jon Ericson

      Companies ought to start paying by the keystroke. Then we’ll see comfortable 8-space indentation like God intended.

    • Ashley Sheridan

      See, you’ve hit the nail on the head, the width of indent is the exact problem that spaces creates and can’t solve. You prefer 4 spaces, Bob prefers 2, Joe prefers 8. Thing is, when you’re using spaces, you are forced to use only one width, whereas with tabs, anyone can set the visual width on their IDE and it doesn’t affect the code for anyone else!

      • Spencer Shanson

        If only it worked like that. Too often I’ve seen files with mixed tabs and spaces because developers have different preferences. So then you ask your IDE to convert all the spaces to tab (or vice versa) and now you inject all these changes into the file diff.

        • Ashley Sheridan

          That’s not a problem with the indentation method, it’s a problem with that team not having coding standards…

    • Bryan Oakley

      I’ve worked on teams that used 2, 4, and 8. Of those, I think I hated 8 the most. I will agree that 4 seems to be the sweet spot — enough to be visually distinctive but not so much that the code extends beyond the right margin.

  • Bruno Brant

    Another cool “statistic:” most of the developers who work with me DON’T have a SO account. Based on my sample I can safely guess that most developers on my company don’t either. (at least at my region)

    That wouldn’t matter – until you I tell you that my region comprises 12.000 people. Not all of them are developers, but it’s a software consultancy, so most are.

    Conclusion: this is the most stupid post I’ve seen. The sample is very, very, very small to the point of having zero meaning. I began reading it as a joke but ended up realizing that the author was “kinda” making a point.

    And the only point is the usual one when reading the interpretation of any statistic data: beware.

    • Most developers in the world don’t have an SO account. That’s irrelevant. An argument that developers who answered the survey are not representative would be relevant.

      • Nutarama

        Is there any reason to believe that the SO userbase is representative? I’d imagine that the SO userbase skews towards self-taught programmers, more extroverted programmers, and more English-fluent programmers. Most people interact with it when they have problems that they can’t answer (professionally taught developers should have a reference text for answers) and only a few of those visitors are going to be willing to take the time to join the site to interact with others and eventually answer the survey.

        • It’s certainly representative of something. The kinds of points you make are exactly what should be discussed if you’re going to argue that there are factors related to the topic at hand that are ill-represented in the sample as compared to the full population.

        • Adam H

          Unless any of those differences in representation is actually a confounding factor for the relationship between tabs/spaces vs salary then none of that explains the reported differences.

        • Cade Perkins

          “Professionally taught developers should have a reference text?” All due respect, but what wonderful reference text do you have that is 1) primarily available only to professionally-taught developers, 2) includes an index of all possible bugs, hardware problems, system profiling measurements, etc, 3) libraries of additional code that does just what you need right now, 4) consider all possible new technologies and languages, etc. Even if you’re correct that SO is not representative of all spacing and tabbing coders, I can’t imagine that your reasons are any more justifiable than the conclusions in the article.

        • “Professionally taught developers should have a reference text?” – what a strange comment!

      • elequ

        Yup, this can also be generalised to every survey of anything ever. This is the way they work: small *sample* of *people who answer*.

        Also are there really many developers out there who don’t refer SO? That’s like saying they don’t use google. As code is not science (ie it can not be independently/empirically looked up), you **have** to look up references. This is a case where SO is probably a relatively solid survey.

        • Bart Van Leeuwen

          You certainly can create code independently and without reference to SO, in fact if that weren’t possible, none of the examples and answers on SO could exist at all. They were invented/discovered by people, often more then once.

  • Laurent

    Reading these comments, one thing space users seem to have in common is a strange feeling of superiority (a recurring argument is that tab users are messy and don’t know what they’re doing, while space users care about the quality of their code), so that could be a clue. Higher self-confidence, regardless of merit, usually translates to higher salaries.

    • Quaid Ferguson

      Yes, when you have good reason to believe you are correct, it inspires confidence.

      • catalysto

        Case in point.

        • Quaid Ferguson

          Case in point only if the confidence is regardless of merit, which is exactly what I was arguing against.

    • elequ

      But don’t tab users just have the same level of confidence for different reasons? Neither is default, you need an equal amount of confidence to use either.

      The neat v messy code argument seems more legit than the confidence one.

    • Bart Van Leeuwen

      I see individuals on both sides in that discussion having a similar strange feeling of superiority.

  • Jasper Rijkeboer

    Who knew that professional developers who have learned to “play well with others” in multidisciplinary environments would actually be paid more than silo’ed purists. Huh…

    • Ashley Sheridan

      If by playing well you mean forcing a specific width of indentation on their code to all devs who work with it, yeah, sure, because that’s what you’re doing with spaces 😉

      • Bryan Oakley

        I’ve yet to see a good argument for why it’s a good thing for different developers on a team to adhere to different coding standards.

        • Ashley Sheridan

          I’ve yet to see a good argument about how indentation is the same thing as coding standards

        • Ashley Sheridan

          Now you’re making strawman arguments. I’m not going to reply in defence of an argument I didn’t make…

      • Bart Van Leeuwen

        Maybe the correlation isn’t very difficult to explain… those using spaces can easily adapt to whatever environment and get things done, whereas those using tabs have more difficulty fitting in with things which aren’t 100% their own choice and waste their time on arguments 🙂

        • Ashley Sheridan

          Actually, I think you’ll find it’s the opposite. Indentation is spaces by default on most editors. Blows your whole argument out the water, eh?

  • the great woomy

    I don’t think you took into account the fact that TRUE DEVELOPERS just use semicolons and have all their code on one line.

    • Robin Munn

      And they eschew inserting those semicolons by such gauche methods as actually touching a key, preferring to use butterflies instead.

    • Mario Rivera

      True developers don’t need multiple statements, it’s a single perl line.

  • Quaid Ferguson

    Using tabs to indent and align code is like trying to use a hammer to clean your windshield.
    Lets say you have a function with a lot of parameters.
    public void foo(int bar,
                            string foobar,
                            …
    Depending on how wide your tabs are and how long your function signature is, chances are this cannot be aligned. Simply not acceptable.

    • Brian Jacobs

      :set ts=2

    • You’ve obviously misunderstood the whole concept of using tabs for indentation

      • Quaid Ferguson

        Really? Then why don’t you enlighten me.

        • If you ask a tab-using heathen, you’ll find their response to be “tabs adjust to whatever size you need.”

          • Bart Van Leeuwen

            And that works as long as your tools properly support that, and as long as the language you use doesn’t differentiate between tabs and spaces.

            Its usually more a case of militant tab advocates suggesting a ‘freedom’ of viewing argument while actually limiting your ‘freedom’ to use the tools of your choice, and also tend to not want to know about how in many professional environments you do not get to pick your own tools.

    • Xandor Schiefer

      There’s a difference between indentation and alignment. Tabs clearly suck at the latter. They are, however, better than spaces at indentation. Indentation is what they are the character for, with no other purpose.

      The Best Way™, is to use tabs to indent and spaces to align. Let each character do what it’s good at.

      But let me also say that consistency in style is far more important than which style is actually used.

      • Bart Van Leeuwen

        (horizontal) Tabs are not intended for indentation, they are intended to move the cursor to the next preset tabstop on a line. It just so happens quite a few people believe this is a convenient way to indent code.

    • Ashley Sheridan

      Ideally your functions should not have that many arguments that this becomes necessary. It’s true this is a failing of tabs, but using spaces to indent now means that you’re forcing every single dev working on that code to use the exact same number of spaces everywhere. So it doesn’t matter if Joe likes 4-space indentation and Bob prefers 2 on his screen, everyone has to have the same. Using tabs, that isn’t a problem, everyone gets to set the visual width of tabs as they please on their own IDE.

      • Bryan Oakley

        > “you’re forcing every single dev working on that code to use the exact same number of spaces everywhere.”

        Why is that a problem? If the team shares the same coding conventions, the code will be easier to read and maintain by the team as a whole.

        > “Using tabs, that isn’t a problem, everyone gets to set the visual width of tabs as they please on their own IDE.”

        It also means that code that looks properly aligned by someone who uses two-space tabs may look like crap for the guy who uses 8-space tabs (or visa versa)

        • Ashley Sheridan

          It’s a problem because not everyone using your code is necessarily a team member.

          Also, if your code alignment looks shit when adjusting tab widths in your IDE, then you’re not indenting, you’re aligning. Big difference, but the sort of mistake I’d expect from someone who isn’t a team player

          • Bryan Oakley

            You can preach “indent with tabs, align with spaces” all you want. In the real world, people who use tabs for indenting will also sometimes use tabs for alignment. That’s just the way it is. I’ve seen it with my own eyes by really brilliant programmers. You can live in an ivory tower and say it shouldn’t be so, and look down upon those less enlightened than you, but that doesn’t change the fact that code that uses tabs will indeed sometimes looks bad if the one doing the reading doesn’t have the same tab settings as the one doing the writing.

            That being said, that’s not the end of the world. If 99% of the code looks fine, I’m cool with that. If you want to use tabs I’m certainly not going to stop you. At the end of the day you’re the one that owns the code you write. If you think using tabs makes it better, that’s all that matters as long as the rest of your team agrees.

          • Robin Munn

            In the real world, people who use tabs for indenting will also sometimes use tabs for alignment. That’s just the way it is. I’ve seen it with my own eyes by really brilliant programmers. (Emphasis mine)

            THIS, right there, is the problem in a nutshell. “In theory, theory and practice are the same. In practice, they’re different.”

            In theory, tabs are better than spaces because everyone can set them to their preferred level of indentation, and everyone knows how to use them correctly (tabs ONLY for indentation, then spaces for any alignment you want to do after the indentation level).

            In practice, tabs are worse than spaces because everyone can set them to their preferred level of indentation, and not everyone who knows how to use them correctly will actually use them correctly, alas.

            And so, the more code I read that has used tabs incorrectly, the more I’m inclined to dictate spaces-only in any project I lead. Because the inflexibility of spaces is the only way to ensure that two coders with different tab-width preferences won’t mess things up for each other.

    • That’s a horrible practice! You rename foo and all your nice formatting goes out the window. If you absolutely have to align, do this:


      public void foo(
      int bar,
      string foobar,
      ...

      • Quaid Ferguson

        If you are using decent tools, the rename refactoring will automatically realign your parameters.

        • I’ve seen so much formerly aligned parameters that I just assumed IDEs didn’t do that very well. I just checked with IntelliJ, though, and it indeed does. So you are right, decent tools (and proper configuration) for the win! I still don’t like this kind of formatting (because horizontally speaking, every parameter list is somewhere else) but that’s more a matter of taste than actual problems.

          Unfortunately for tab-lovers like myself, IntelliJ supports your original argument. The aligned parameters should use the same number of tabs as the line above (for the indent) and fill the rest up with spaces (for alignment) but it doesn’t. Instead it uses as many tabs as possible so things get unaligned for a different tab length.

  • Turi

    Simple solution: Use tab and automatically replace tabs with four spaces. Best of both worlds.

  • KlingOn2K

    Now I know EXACTLY why I am underpaid !
    I have been using those doggone tabs for 10 years !!
    Bye, bye tabs. Spaces, here I come !!!

  • BillBasham

    Obviously we are paid by the character…

    • AndrewEddie

      The income per character is higher for tabber’s 🙂

      • Ashley Sheridan

        That makes no sense…

  • Lawrence Mok

    may be it’s 8.6% increase in file size…….

    L E T S U S E M O R E S P A C E

  • weffyman

    what if some editors are adding spaces when user tabs?

    • Then you are using spaces.

    • Ashley Sheridan

      You can change this setting in your editor 😉

  • Nokola

    Most developers who use tabs didn’t have time to answer the SO survey because they were busy counting the ton of extra money they were showered with 🙂

    • Ruby Linquista

      This is sort of the answer I wanted to find on here. Also, StackOverflow itself skews results because it has a certain demographic.

  • People! Just map your tabs to spaces in your editor and let’s have this debate over with… 😀

    • Yeah, then go to your boss and tell him, that you now need to get more money 😀

    • Ashley Sheridan

      Yeah, so Joe maps his tabs to spaces, and sets his IDE tab width to 4 spaces. Bob comes along and doesn’t like 4 spaces, it takes up too much room on his screen, he prefers 2 spaces. He changes this in his IDE. Bam, he’s just changed every line of code, and Joe isn’t happy. If only they knew how to use tabs properly, this would never have happened!

      • David Robinson

        True, but then they’d lose 8.6% of their salary.

        • Ashley Sheridan

          correlation ≠ causation 😉

      • Bryan Oakley

        It can go the other way. Joe uses two-space tabs. His code looks all nice and pretty and readable. There are a few odd sections that need to be indented 12 characters over so he uses six tabs. Bob comes along and has an eight-space tab. Suddenly all that code that needed to be indented 12 characters is now indented 48characters, and looks like crap because half of the code is beyond the right margin.

        • Ashley Sheridan

          That’s not how tabs work. It’s cute that you’re trying to get involved, but you don’t know what a tab is, so maybe leave your betters to discuss stuff, eh?

          • Bryan Oakley

            “it’s cute” is such a juvenile response.

          • Ashley Sheridan

            Discourse is horrible for so many things, that’s not the fault of tabs, and trying to make it so is daft at best.

          • Bryan Oakley

            I’m not saying it’s the fault of tabs. What I’m pointing out is that there are many tools used by real world programmers that don’t play well with tabs. Discourse is but one of many tools I’ve used over several decades that doesn’t handle tabs properly.

            For that reason, tabs are IMHO a less practical choice unless you work in a relatively closed ecosystem.

        • Ashley Sheridan

          Another strawman, good for you. Stop confusing alignment with indentation.

  • Alex Lev

    What about ANOVA?

  • Saurabh Gupta

    Error Bars please?

  • Cade Perkins

    New resume skill: Code with spaces only.

    • Reini Urban

      Nope. Use the right tool.
      But sometimes MSVC is the right or better tool, and still people get away with tabs, even with 4 char tabs, which is very common amongst MSVC coders.

  • Stelios Serghiou

    Strictly speaking, causal inference is impossible in cross-sectional data because they violate the principle of temporality, i.e. we need to observe exposure (in this case tabs/spaces) and baseline values, before the outcome of interest (in this case salary). Thus, we cannot use causal language in describing this estimate. Nevertheless, even if we were willing to assume that our data would have remained unchanged had this been a prospective study (which is not unreasonable for variables such as country of origin), after having had a look at the raw data, it would take a while to turn this dataset into a readily analyzable object. The main issue would be the huge amount of missing outcome data, some of which is probably missing at random, some of which is most probably not. Certain variables also contain multiple responses for each person, which would have to be dummy-coded, but that’s not too big of an issue. After dealing with these, the easiest approach would be to use principal components analysis to identify components of interest, use them to calculate propensity scores (i.e. the probability of an individual using spaces/tabs) and then run ordinary least squares of outcome on exposure and propensity score. There are more interesting approaches as well (e.g. double machine learning)..

  • Cade Perkins

    s/t/ /g

  • Cade Perkins

    The majority of tab users must be from regions where the comma and period are reversed in numerical values. “Do you indent code with tabs? Yes” “What is your annual salary? 130.000” $130 would certainly bring down the average.

    • David Robinson

      A. The above post used median, not average
      B. The effect was entirely clear only within the US, as shown in the second graph above

      • Cade Perkins

        I was just adding some humor, so median or average wouldn’t matter. But I’m not sure how you’re reading the second graph. It looks apparent to me that the effect is there in all countries shown, not just the US.

      • Ashley Sheridan

        Median *is* an average. Don’t fall into the trap of assuming average == mean 😉

    • Tim Hitchins

      In continental europe they use the apostrophe (‘) not the . I believe.

      • Tom Walton

        Not for thousand separators, most use ‘.’ As in 1.000

      • Cade Perkins

        Just a little humor. I didn’t see the survey, but I assume it didn’t accept such erroneous values. It is just humorous how many serious responses there are to this–it needs a lighter side. Otherwise, I’m familiar with German and some other European formats and they definitely use a period for thousands separation (and many use a comma for the decimal delimiter).

      • Attila Fulop

        OK, here’s the real twist: in Hungary and in Romania we use spaces for thousands separator. Maybe we could start using dots for indenting, just need a decent transpiler 😀

      • We don’t. I guess the most common is a space as the 000 separator and a dot or a comma for the decimal, depending on country.

  • Cade Perkins

    There must be a correlation between size and number of thumbs each coder has vs the size and number of left little fingers.

  • Juan Story

    Another explanation would be that developers who use spaces lie about their salary

  • Clearly users of spaces are more prone to lying about their income than are users of tabs 😉

  • Ruchit Surati

    Just because there is a co-relation, doesn’t mean it’s a driving factor. Misleading hypothesis.

  • Considering that the use of tabs is highly editor dependent as well as platform dependent, I seriously doubt that it is tabs vs. spaces that is driving the salary numbers. IMHO, it is far more likely that a premium is being paid for environments where tabs are not generally used. Plotting individual technologies individually would be far more clarifying (e.g., z/OS assembler, C on Windows, Python on Linux).

    • Ashley Sheridan

      I don’t understand how a tab can become editor dependent? A tab is just a byte in the code. You set your editor to display a tab as a certain width of characters. That’s it, simple. There’s no dependency on anything. If you move to another IDE, just change your default settings there to your liking (as we all do, who likes to be stuck with stock layout and colours?!) and then you’re all set.

  • natalinobusa

    great. That settles spaces vs tabs now let’s clear line terminations styles. 🤘

  • Attila Fulop

    We’re using tabs, because it’s God’s word. Except for Spacial Fridays, then we can use spaces.

    • Victor Stafusa

      Tabs are a creation of the devil to seed discord between the men.

      • Ashley Sheridan

        Tabs came first as the best way to indent. Spaces came after because people didn’t know how to use tabs and line things up with spaces. We laughed at them when they did it on typewriters, we laughed louder when they did it on word processed documents, now we cry when they do it in their IDE. 😉

        • Bryan Oakley

          The horse and carriage is the best way to travel, since it came first. Cars are for people who don’t know how to handle horses.

          🙂

          • Ashley Sheridan

            Oh, I’m sorry, would you like me to dumb it down to idiot level?

          • Bryan Oakley

            No thanks.

          • Ashley Sheridan

            You’re great at these strawman arguments aren’t you? See that bit where I said that the spaces indentation is because people were idiots and didn’t know what a tab was? That doesn’t make spaces better; in-fact if you’ve ever seen someone trying to indent something with a typewriter using spaces, it’s obvious that spaces are not superior in the same way that a car is superior to a horse and cart. Comparing two different things makes no sense and derails the discussion.

          • Bryan Oakley

            All I did was point out the fallacy of your “tabs came first” argument. Just because something comes first doesn’t mean it is the necessarily the best solution in the modern world. Many things come first, we learn from them, and we adapt.

      • Attila Fulop

        Do you have Tabular Fridays then?

  • Indomitable Jision

    How does that defines what is more optimal spaces or tabs??

    • Ashley Sheridan

      The best argument I’ve seen for each: spaces allow exact indentation for when code wraps onto more than one line (yes, it’s not ideal, but it *does* happen). The arguments for tabs are: allow you to indent to exact points consistently, allow you to set the visible tab width without changing the actual code by a single byte, use less space on the hard drive/memory 4 bytes for 4 spaces Vs 1 byte for a single tab (a poor argument that last one, but I’ve seen it used)

  • Alexander De Sousa

    I would imagine it’s the IDE the developer uses, i.e. cheap companies paying cheap salaries will only supply cheap IDE’s which may just happen to have tabs as default software.

    By contrast high budgets, high salaries, good IDE’s.

    P.S. I haven’t checked what the defaults in each IDE are.

    • Ashley Sheridan

      What would you class as a cheap/good IDE? I’ve yet to see an IDE that couldn’t use both, and allow the dev to switch between the two. Of course, when it’s all in your imagination, then I suppose anything is possible…

      • Alexander De Sousa

        Cheap = free, Good = paid. I know you’ll pick me apart on my original wording there as you can get good free IDE’s but that’s not what I’m talking about.

        I’m also not talking about an IDE locking you into a specific preference, I’m looking at what comes as default since we developers are too lazy to change that default.

        The 2 big players here are Eclipse (default is tabs) and IntelliJ IDEA (default is spaces).

        In that situation it becomes more a reflection of the company, i.e. a company valuing the tools a developer uses enough to pay for them may also be competitive with salaries. By contrast a company forcing developers to find free IDE’s as a means of cost saving, may also be a little tighter on the salaries.

        • Ashley Sheridan

          I’d say Netbeans, Visual Studio, and PHPStorm are also pretty big players here too. But I agree, developers are inherently lazy (that’s why we spend our time getting computers to do things for us) so we tend to go with whatever defaults the IDE suggests.

  • Jacob Raihle

    Explaining the result is easy: If someone is going to force me to use spaces, they better be paying well.

  • Meet Taraviya

    This is an elaborate lie cooked up by space users, that’s what they are good at!

  • tonicboy

    Fascinating post but obviously, there is _some_ confounding factor which just isn’t apparent yet. I mean, it’s literally impossible for spaces to be a _cause_ of higher salary. If that were the case, then developers should be able to switch from tabs to spaces and see their salary increase (good luck with that!).

  • agtrier

    You may want to look up “spurious correlation”…

  • Boris The Blade

    I think the cause is somewhat reversed. I strongly believe that people who use – and fight for – spaces are young and proud, quick to respond when you ask their salaries. Speaking generally of course. They also likely to use a modern framework like PHPStorm, or a freshly invented editor like Atom, they use Git for version control, share their work on github or other communities, also format their code with autoformatters – these things typically cause spaces. The key concept here, I believe, is that they’re TEAM PLAYERS, most with university degrees. Yes they earn more.

    Whoever uses tabs clearly doesn’t give a sheet who reads their code. One-man companies, freelancers, not speaking about their salaries or not having a consistent value per month. Tabs have added value when you code but are somewhat annoying when you git often, or when others see your code in a viewer with 8 as default tab size.

    These are factors to consider.

    I use tabs and I’d typically not tell my salary. I don’t use it for reasoning.

    • Ashley Sheridan

      Erm, whut? PHPStorm isn’t a framework, it’s an IDE. I’m not sure I can take you seriously now!

      Given that you also don’t know that tab size is arbitrary, you don’t seem to quite understand. The argument you’re making against tabs is actually the opposite of the situation and the exact argument that shows why space indentation is a problem…

      • Boris The Blade

        (facepalm)

    • Aelem

      So many BS.
      1. “Young and proud” don’t earn more. They earn less. Because they’re young.
      2. Freshly invented editor Atom tries to detect which mode is used in the file we edit and sticks to it. If it can’t, it defaults to spaces, but can be switched to tabs in settings. Also modern editors respect .editorconfig file.
      3. Neither git nor github don’t have any problems processing tab-indented sources.
      4. “Whoever uses tabs doesn’t give a shit who reads their code”. BS. It’s the opposite. With tabs, I’m giving you the chance to setup your editor / source view to your preference. With spaces, I don’t.
      5. I use tabs and I have no problem telling my salary. And I earn more than most of other developers in my country.

      • Boris The Blade

        1. Read again. Team players with uni degrees do earn more.
        2. Yes, practically all editors can do this trick. Missed the point.
        3. Yes they do. Not git itself, of course, but people with different indenting habits, working together. Some clients stick to the idea that whitespace changes are changes.
        4. Interesting idea but no. If you care about others you’ll practically always convert your tabs to spaces, to make it viewer-agnostic – in other words, to make your code look exactly one way and not another. Simply put, I like tabs but teams usually don’t.
        5. Maybe. So what.

        • Aelem

          1. BS. Everybody is a team player. Uni degrees does say literally nothing about whether the individial is young or uses spaces. Young people earn less, because they are not that skilled yet professionally.
          3. The problems is different indenting habits, not using the tabs. If the tabs are used and enforced in the whole project, there is no problem at all. If the spaces are used but not enforced, you can get into the problem as well. Different indenting habits does not say anything about whether tabs are better or spaces are better.
          4. I don’t think you can be serious at this point. How can setting something to be viewer-agnostic be helpful to the viewer. It’s viewer-agnostic, you said it your self. Not viewer-helping. I, as viewer, don’t want to see your ugly code indented with 2 spaces. I want to see it indented 4 spaces.
          5. Nothing. Exactly like your last paragraph in original post.

          • Boris The Blade

            1. No.
            3. Yes, that’s what the whole discussion is about.
            4. If you want to see a code differently, format it. But space believers have a valid point when they say “I wrote it like this so it should look like this”. When I post something for code review I convert my tabs to spaces. They ask me to and I respect them. I mean I see your point but it’s almost unique, I encountered two or three people thinking about tabs like that. Most of them use the de-facto standard (4) and convert them back and forth as needed.

          • Aelem

            1. Maybe you’re too young. Go ask your colleges.
            3. No. The discussion is about whether tabs or spaces are better. Tabs are better. Mixed indentation is bad in all cases.
            4. Format it. You’re kidding. So what you’re suggesting is not to be a team player. Actually, that’s why tabs are better than spaces. With tabs, I don’t need to reformat the code and still get the way of seeing the code I like.

            “They ask me to and I respect them.” – of course. When they use spaces, I use spaces (on that project). That is crucial. But it doesn’t say anything about whether spaces are better. They are not.

          • Boris The Blade

            This discussion is NOT about which one is better. This is about a correlation that’s hard to explain. And kids, how many times do I have to tell you I’m using tabs? Please don’t start to convince me about them. I’m using them since the 1900s. I know the pros and cons.

          • Aelem

            You made some statements, such as “Whoever uses tabs clearly doesn’t give a sheet who reads their code”, which are plain wrong and that’s what my replies were about. The fact you’re using the tabs doesn’t make them right generally. Maybe you should have written “I use tabs and don’t give a shit” instead.

          • Aelem

            *doesn’t make the statements right

          • Boris The Blade

            Whoever wants to understand what I’m saying already does.
            Whoever tries to misinterpret can always find a way to.
            This conversation serves no purpose. You never learn. Keep posting “this is bs” on everything and be happy.

          • Aelem

            Well, whatever. You’re wrong that I tried to misinterpret. I didn’t. I don’t think I did. I can finally agree with you on that this conversation serves no purpose, because you never learn either.

          • Tomasz Przybysz

            >You made some statements, such as “Whoever uses tabs clearly doesn’t give a sheet who reads their code”
            Because that’s true. I replied somewhere above to this but let me repeat myself. Try to set how tabs are displayed in tools / web pages, which simply don’t have possibility to set this. You’ll end up being ‘forced’ to view tabs as 8 spaces and this usually has a really bad impact on code readability as it gets too wide to fit on the screen (text column).

            I don’t really care about what character is used as long as it’s not mixed in a single codebase. However if codebase is meant to be shared among a team or even public, use of spaces guarantees there will be no issues which are brought by tabs.

          • Aelem

            No, it’s not. If you use wrong tools, it’s not the problem of tabs. It’s the problem of IDE. Even github can display different size of tabs with the right setting. https://github.com/tiimgreen/github-cheat-sheet#adjust-tab-space

            There are no issues brought by tabs. Only issues brought by mixing the styles.

          • Tomasz Przybysz

            I’m just pointing out that with spaces there in no problem at all, no matter what tool is in use. This is a sufficient argument IMO, as use of spaces is always effortless.
            So all goes down to whether someone prefers to pay some additional effort for more flexibility (adjusting how the tab is displayed). In a team the choice is more often not to go with this path. What is a choice of a single dev coding “to his drawer” is a personal preference and no one cares, I guess.

            As I don’t mind much use of either tab or space for indentation, I totally agree that mixing is a great no-go.

          • Bart Van Leeuwen

            You do not always have the choice of tools. Also, who are you to tell anyone what the ‘right’ tools are? The team player who advocates that tabs give you freedom to change the indentation at the expense of choice of tools? That sounds like penny wise but pound foolish.

          • Bart Van Leeuwen

            You so far make a purely theoretical argument about why tabs would be better which simply ignores a number of things from reality.

            What I’ve noticed over the decades is that people who strongly advocate tabs often have a strongly academic approach to things (which certainly has its value), but just as often get too distracted by what could be better in a theoretical idealized world simply does not work that way in practice.

            So all theoretical arguments aside, spaces work regardless of the tools, whereas tabs are problematic with a number of tools. Simple conclusion, in todays non ideal world, spaces are better in spite of the theoretical advantage of tabs.

          • John B

            I’m going to go out on a limb here and say Aelem is a better developer when it really comes down to it. More value add. I’ve seen this time and time again. Generally people that are ardent about this debate either way are wasteful fools, but I’ve consistently noticed the spaces people arguing for their side using tactics Nassim Taleb would describe as “Intellectual Yet Idiot”. They’re elitist and don’t truly think from the perspectives of other people, just some mythical “team” ideology they’ve made up in their minds.

          • Bart Van Leeuwen

            “Everybody is a team player.”

            Uh no, but being a team player also has zero to do with having a university degree.

            “The problems is different indenting habits, not using the tabs.”

            Got a point there. Want to work on a project as a team? ONE indenting style, and you stick to it, no exceptions.

            “I don’t think you can be serious at this point.”

            I’m sure you are simply not getting it due to lack of experience with a very wide range of editing and viewing tools. No, not all of them let you set tab size, and many of them will default to 8 and create totally crappy output, WITHOUT the user being able to change that. Also there are many situations where the user simply has absolutely zero choice in what tool to use. Spaces work the same everywhere, and ensure consistent formatting and hence viewing in every available tool. It indeed removes a tiny tiny fraction of freedom for the viewer to set tab size to 22 instead of 4 or whatever you want, but that is really a small price to pay for everyone being able to at least use it.

            As team player you should be putting what works for everyone in the team over whatever personal preferences you might have, the later are for your personal pet projects, unles you happen to be the team lead and in the position to make your own preferences the standard.

  • Wasim Hyder

    https://uploads.disquscdn.com/images/8895e686a0cbe16d05edb1ad08c4ad876b48d8d23eb50018f071fbaab43688cf.jpg

    Now I know why he has troubles in making his company stable.
    IYKWIM 😛

    • Joe Delekto

      Too funny, I actually caught that subtle exchange in a recent episode where he didn’t hire one of Gavin’s suggested engineers from Hooli because he used “spaces instead of tabs”.

    • Yung-Chun Lu

      Can not agree more T^T

    • Xsmael The-Best

      i dont get anything…

      • Wasim Hyder

        Xsmael it a reference from HBO TV series named “Silicon Valley” where person in the picture “Richard Handricks” is a developer who is trying to run a compression company with his revolutionary compression algorithm and is obsessed with the use of tabs over spaces.
        It is a great series. I think you should watch it.

        • Xsmael The-Best

          oh okay, now i kow why i didnt understand, i’ll give it a try when i get free time, thanks!

        • Xsmael The-Best
  • Cedric

    Could it be that guidelines tends to favor spaces, and that bigger companies tends to have guidelines (and enforce them), and also that bigger companies pay more ?

  • Pat McKillen

    You don’t need a survey of this size and complexity to come to the conclusion that space is better than tab. Imagine the sort of childhood people of my generation would have had it the tab brigade had won. I would have played “Tab Invaders”, Captain Kirk would be talking about “Tab, the final frontier” and David Bowie would have had “Tab Oddity” as one of his many many great songs.

    On the flips side, I would not be the owner of a Tabby Cat but rather a Spacey Cat – which would be kinda nice.

    • Bart Van Leeuwen

      The survey does not say that, rather it says there is a curious correlation and points out, more then a few times, how that does *not* imply causation.

  • one of the first things when you start as developer is question spaces or tabs
    whoever I asked years ago said spaces, as Tabs has different settings in different computers so that was easy one, it respects the nature of programming which is make it work everywhere possible

    • Aelem

      That’s BS. The possibility of setting tab width is actually an argument for Tabs, not against. Also, I say tabs, so I may be your first. 🙂

      • Toon Van Acker

        This only *really* works if you use tabs for indentation, but spaces for alignment past indentation, tho. Otherwise you can get awful results when you vary the tab size.

        • Aelem

          Don’t use alignment. You don’t need to.

      • Tomasz Przybysz

        I know that this argument is used as a tab advantage but it’s an invalid argument. Please see my comment over here to understand why (shortly, there are many places in which one has no influence on how tabs are displayed).
        https://stackoverflow.blog/2017/06/15/developers-use-spaces-make-money-use-tabs/#comment-3364871754

      • I think you should listen to Tomasz and don’t be ignorant and proud for being wrong 🙂
        not necessarily totally wrong, but wrong about tabs being better option for viewing code

  • John

    What if I use tabs but my text editor convert them to spaces ?

    What if I use spaces, but use tabs in Makefile ?

    • Bryan Oakley

      Then you are in the “spaces” group. It’s not about the key you press, or about languages that require literal tabs. It’s about what character is in your source code to represent indentation.

  • Frank Sheeran
  • Frank Sheeran

    I’d like to see the same comparison between emacs and vi, and between various Unix shells.

  • And there they come out of their holes, all those tab-lovers, screaming at us to indent code with a character designed for indentation. You know what? Fuck them! Spaces for the win!

    In fact, spaces all the way! Are you still using line feeds to begin a new line? Boy, all that trouble across different operating systems (to carriage return or not to?) and editors is just not worth it. If you stopped being a Tab-hitting infant, become a real man now and stop using Enter as well! I just fill my lines with spaces until the editor wraps it around. That’s what true 10x ninjas do.

    • Bryan Oakley

      Son, the 1950’s ended a long time ago. 🙂

  • sh4dow83

    I’m not sure how reliable this is (and any of the salary statistics in the developer survey) considering that you may have mixed part time and full time positions without normalizing those salaries based on the hours actually worked.

    I looked for information about this in the methodology section but since it wasn’t mentioned and that is a common “mistake” (many would probably argue that it doesn’t matter – because somebody who earns 120K for 60h of work per week on average still makes more than someone earning 50K for 20h of work) in salary statistics, I have to assume that you made it as well.

  • Steve Powell

    Interesting; I discovered the other day that YAML files don’t like tabs (different type of file so my editor’s TABS-to-SPACES conversion wasn’t activated, duh!) and of course Python (is it? or at least one language) has indentation being significant, whereas most are ‘free-form’. I know that Assembly languages vary greatly in their acceptance of tabs and their use of spaces. (System/390 Assembler would (still does?) barf on HT or VT characters, but that’s not surprising and largely of historical interest these days.)

    These might be confounding factors it is hard to tease out of the gathered stats.

  • Victor Stafusa

    For me, I think that most people that uses spaces are already hardened enough to:

    (1) hate the confusion that sloppy/begginers developers do in code base by mixing tabs and spaces in code making the idented tab-size a horrible mess that not works for anyone;

    (2) hate to always be setting the tab size to different settings accordingly to the project (or worse yet, different settings within the same project, or even within parts of the same file);

    (3) hate to see badly idented code when reading e-mails or browsing github. The e-mail client and the browser have no clue about how to correctly set the tab’s size and it is not easy for the user to set this (possibly a different setting for each e-mail and each webpage). Also this is something that should not be a burden to the user.

    (4) hate to get conflicts in git/mercurial/SVN/whatever caused by inconsistences in the use of tabs and spaces (most likely due to mixing them in the identation).

    (5) get disappointed to see that there is some issue in line 234, column 48, but can’t be sure of which column is 48.

    So, more experienced developers which are perfectionist about code, will tend to see that the only way to fight against that mess is to ban tabs to the hell forever, somehow turning them into compile errors.

    • Aelem

      Or ban spaces. The result would be the same.

      • Tomasz Przybysz

        It wouldn’t. You go to view diff of pull request on GitHub and tab indented code is too wide for convenient side-by-side view as GitHub displays tab as 8 spaces.

        • Aelem

          🙂
          Actually this is the best argument against tabs I have seen so far.

        • Aelem

          Kidding. See https://github.com/tiimgreen/github-cheat-sheet#adjust-tab-space
          Every good source code viewer must handle this properly.

          • Tomasz Przybysz

            Good to know, perhaps it’s a new feature or I was just unaware of it.
            Anyway, this way or the other it involves some of effort of finding an appropriate setting option as well as setting it (sometimes each time as here an url has to be amended).
            There are not so good tools in use as well and sometimes it’s not up to a single developer to change a current tool in use. Worth of keeping in mind.

  • Good read.
    Although I have a theory where it comes from.
    I know a lot of programmers that think they’re using tabs, while they’re actually not. Just because they press tab key it makes them think it’s what they’re using.
    And since they finally find it out they realize they were using spaces all the time before. But until they’re less experienced they think it was tabs they were using. Hence there is more inexperienced developers that *think* they’re using tabs, while they’re actually using spaces and that could explain an origin for this inequity

    • Bob

      Conversely, there are some programmers who think they’re using spaces, while they’re actually using tabs.

      For example, when I’m writing in vim, I press the tab key to insert four spaces. When I write in notepad++, I have the option ticked in its settings to behave the same way – replacing tabs by four spaces.

      Or so I thought.

      Turns out, I had that option unticked for the longest time, and I only found out recently when I opened one of my notepad++ scripts in vim, did some changes, and Python started screeching at me about indentation errors.

      Hopefully I’ll get a paying job soon, now that I am correctly using spaces for all my indentation.

    • Xsmael The-Best

      i’m probably part of those who think they use tab Just because they press tab, tell me the difference, how do you actually use tab, and when do you know you are using spaces ?

      • Most of the times it’s set in your editor.
        For example Emacs always uses spaces unless you set it to do otherwise (f.i Makefile requires tabs). I use Atom and Spacemacs and both of them were using spaces right out of the box.
        A good way to check it, is probably to enable invisible characters in your editor.
        It should look like this:
        https://uploads.disquscdn.com/images/d6893f5f519e1ec8cc5716c90ff37173c09ab5f808ae495923299eb9daf0abe9.png

        • Xsmael The-Best

          alright, so let say my editor, print spaces whenever i press Tab, does that make me part of the developpers who uses spaces ? and potentially make me more likely to be rich :p ?

          • Yes. That’s the thing (and also a scene in Silicon Valley series that made me mad). People who uses spaces don’t just press space 2/4 times to indent their code. They use tab key, it’s just the editor substitutes that with a set amount of spaces
            So yes. We can all be rich now 😀

          • Xsmael The-Best

            ROFL! i thought that the space users would press it several times to indent, and when i was reading the arguments promoting the use of space and how people are fighting for space i was just wondering how it can be better, since it wastes your time…. anyways thanks for clarification

          • Bart Van Leeuwen

            It may take a little extra time to use the space bar indeed, but if that difference is so big to actually matter, there is something terribly wrong with the typing skills of the person for whom it matters.

          • It’s not about time. It’s about effort

          • Bart Van Leeuwen

            1. the post I replied to litteraly says: “i was just wondering how it can be better, since it wastes your time”

            So, that clearly argues it wastes time, and *THAT* was what I replied to.

            2. The argument just as much applies to effort. Pressing the space bar a few times is indeed more effort, but if the difference is such to actually matter in any meaningfull way, you might want to review your editing style a bit (200 spaces is not useful indentation 🙂 ) or there is something wrong with your typing skills.

          • 1. Oh didn’t notice that.
            2. There is a quote I really like “Skill of fast typing for programmers is as important, as a skill of moving pawns fast, to a chess player” 😉

          • Bart Van Leeuwen

            🙂

            Thats a nice quote and there certainly is a fair bit of truth to it as well, but I know more then a few coders who are indeed limited by their ability to get the code they have in their head into a computer.

            Also, the ability to hit a single key repeatedly with little effort isn’t really an indication of good typing skills, but inability to do so a clear indication of very very bad typing skills.

          • Bart Van Leeuwen

            Some do, some don’t.

          • Never seen a programmer that would type spaces by hand. Entire programming profession is about automating tedious tasks. If you don’t automate as simple thing as your own indentation then I’d say it says a lot about a programmer like that

          • Bart Van Leeuwen

            That is a bit of a simplistic view on the programming profession. It certainly valid to part of it, but there is much more to the profession then that, for example using computers for things which would simply not be feasible to do by hand, making them do things which do not have any physical world equivalent at all, etc. Automating tedious tasks is also one of the things one can do with programming, a very useful thing, but probably by now not anywhere near the most prominent thing.

            At any rate, it in part depends on what editors you use, what editors you ‘grew up with’, and the capabilities those have, but also on the languages you use.

            I very strongly prefer consistent behavior over saving 3 keypresses. A tab should result in a tab, and a space in a space. That makes the editor work in a consistent way regardless of if I’m editing a Makefile, some python source, some assembler or whatever (note how some of those differentiate between tabs and spaces, where others do not).

          • Bryan Oakley

            It makes you someone who uses spaces. The question isn’t about which key you press to get the indentation, the question is about what character is actually in your source code.

    • Bryan Oakley

      I’ve had the same thought as you. In fact, a few of the responses here in the comments seems to show confusion on the matter. I’ve seen at least one person who said something like “I use tabs. Of course, my editor converts those to spaces”. What they should have said is “I use spaces, though I use the tab key to insert the spaces”.

      I’m willing to bet that if the question were less ambiguous (for example, “my code has literal tabs in it for indentation”), we might have had a slightly different outcome.

  • Gerwin de Groot

    And Do People Who Capitalize Every Word In Titles make less money than people who write readable titles? That, at least, would be fair.

    • That’s called “title case”, a traditional English convention for publication titles practiced in UK and US.
      People that do that probably have a good grasp of English.

      • Publications in the UK typically put titles are typically in sentences case. Perhaps gp is not accustomed to US English.

    • KlingOn2K

      @gerwindegroot:disqus, they end up getting capital punishment.

  • Albin CR

    So whats the point of all of this??..

    • Franklin Fotang M

      I’m wondering too.

    • Whaaaat?

      It’s a clickbait.

    • Bart Van Leeuwen

      There being a curious, and to many unexpected correlation between those things?

  • Thomas

    I changed VS from tabs to spaces, but my boss won’t give me a raise. Is he wrong?

  • v@disqus

    Maybe if we admit that no self-respecting developer would use tabs, this result is less surprising? 😛

  • Dani Pardo

    Jezz, he even wrote some source code to analyze the data and produce the graphs, and pushed that to github! That’s what I call being bored and having nothing better to do! LOL!

    • a20

      Nice try tab-user.

      • Dani Pardo

        SShh!! Don’t tell my boss!

  • Jean Vincent

    This is amazing, definitely worth a scientific study to try to understand why.

    I do have an idea, not trying to offend people who have a preference for tabs, I suspect that people who use tabs may have a less efficient mindset in the entreprise that overall yields lower salaries.

    It may be because they are too obsessed with low-level, less-important optimizations, lacking a sense of balance with the large set of consequences of a single decision. Not seeing that a good decision from one use case may become a bad decision if it yields a larger set of issues with the set of all use cases.

    So when confronted with other complex decisions, they might be more likely to focus excessively on a narrow set of less-critical advantages, disregarding the larger set of more critical disadvantages of a particular decision.

    When this is repeated over a large number of decisions, this might result in less efficient learning, work and collaboration, these inefficient results would be picked up by professors, colleges and managers, yielding lower salaries.

    A compounding effect might be linked to frustration. The narrow-cases-obsessed individual might become frustrated by his or her inability to convince other people of the validity of their thinking, which is more likely to yield negative, sometimes aggressive, attitudes that are quickly picked up by management yielding lower salaries.

    There may be a link with the large spectrum of autism that seems to be prevalent with software developers, some known to be beneficial, but in some cases, it may become counter-productive.

    That is definitely worth further study.

  • Simba Lion

    Wow look at those salaries. Developers need to _STOP WORKING FOR
    PEANUTS_. How is anyone supposed to get paid what they’re worth when so
    many are willing to work for half of what they deserve?

    “But they’ll just hire someone else” Who? If the majority of competent
    developers refuse to work for entry level technician salaries, who
    precisely will the managers hire? They certainly can’t do the work
    themselves, or they’d never hire anyone.

    It’s a developers market, stop being afraid to reject crappy offers.

    • Aelem

      In my country, average salary (across all people, not just developers) is $12k. That’s an EU country. Average salary accross developers is $20k per year. Do you still think I could reject “crappy” offers for $40k?

      • Simba Lion

        So do something about it.

        Do you think Americans get paid more because that’s how God wants it? We get paid more because we fought FOR DECADES for higher salaries, and we never stopped fighting.

        Y’all are getting ripped off, I bet your CEOs are raking in just as many millions as CEOs in America, but for some reason the front line workers who do 100% of the actual work are making less?

        Stop working for crappy pay. If you keep taking whatever they give you they will never give you anything worth taking.

        Freelancing and starting your own business are a good answer to this problem. When companies can’t find anyone worth hiring they will have to increase their compensation packages. If all developers were freelance we would all set our own salaries. I bet they’d go up.

        • Esseuhene

          In many other countries (like in France for instance) you are less paid because you have a 100% social security cover (or other advantages like more holidays, less worked hours etc) contrary to US 😉

          • Lorinc Sonnevend

            Exactly! How many paid vacation days do you get, Simba? What about parental leave?

          • RC_RC

            And what about health care in the US?

        • Aelem

          What do you suggest I should do? Stop working? You don’t realize USA is a rich country. Slovakia is a post-socialistic country with ruined economics. The things are getting better here, slowly, we can’t just skip from 20k average to 100k average in a month or so.

        • Aelem

          Sorry, I misread the freelancing part. Yes, starting my own business could be the answer. Maybe if I was in USA.

          Here the economics is such that even if I started my own business, I would probably earn even less or eventually I would fail.

          Also, starting a business requires money (loans?), requires having manager skills (which I don’t have) and requires the competition ability. And if I hired people that I’d pay 100k or even 50k, my company just would not be able to compete on this market.

        • RC_RC

          CEO’s in other countries make less than American CEO’s in general.

        • Bart Van Leeuwen

          Lets merely conclude that 1. compensation covers more then just the money you directly receive each month, and what that ‘more’ means differs wildly from state to state within the USA already, and even more so between different countries, and 2. cost of living varies as wildly between states in the USA, and even more so between countries.

          I could move to a neighboring country, and triple my income, but would have to work twice the hours, and face a triple cost of living. Good deal? not at all as I’d not end up having more money to spend but I’d have less time to enjoy things anyway…

          Please go experience living in other countries for a couple years, I’m
          sorry but your post is full of presumptions and misconceptions. It would really help if you’d start by learning things are different in different places and use that knowledge when in a discussion with people from all over the world about something which is certainly not specific for where you live.

      • Elizabeth Black

        $12k… yikes. That’s less than my rent for a year and I live in a one bedroom apartment. Funny how $$ means such different things depending on where you live.

        • Aelem

          Here in Bratislava I paid $6.7 for the same type of apartment, so as you can see, although we earn 4x less, we only pay 2x less for the apartment.

      • Mark Zabel

        Relative salary is what matters. I live well in Upstate NY on my salary. In Manhattan I’d be a pauper.

    • Bryan Oakley

      $40,000 is a large salary for some parts of the world. Let me guess: you live and work in either silicon valley or in new york or chicago where the cost of living is sky high. Am I correct? There are places where $40k is quite livable, and some places where you can live like a king on $40k/year.

      • mechler

        You’re right about some parts of the world, but I live in a suuuuuper low cost-of-living area and $40,000 is still peanuts.

        I’m with you on this. It’s livable. It’s still a developer’s market and the skill is more valuable than it is being paid.

  • Xsmael The-Best

    Am a bit confused, what does matter in this study ? is it press TAB versus pressing SPACEBAR on the keyboard, or is it comparing the spaces characters VS tabulations in your code ?
    Am asking this because it does matter, just pressing the TAB key doesn’t guarantee a tabultion wil be printed it might be spaces as well

    • Bryan Oakley

      It’s about the character that appears in the source code. Most people who use spaces for indentation do so by pressing the tab key.

      • Bart Van Leeuwen

        *SOME* people who use spaces for identation do so by pressing tab for sure, others do so by pressing the space bar. If that makes for most people is not clear from this data in any way, and is merely an asusption some people make based on what they do themselves.

        Unless you have verifiable data confirming that most people who have spaces as identation in their code actually press the tab key, or at least have an argument as to why your statement is likely true, its just that, an unfounded conjecture.

        Here is a possible substantiated guess: most people who grew up learning programming on IDEs and who have space chars for identation in their code do actually press the tab key.

        Virtually everyone who learning programming using more generic text editors for editing their code and who have spaces in their code for identation press the space bar.

        The logic? Most IDEs let you configure the tab key in such a way, while few of the traditionally popular editors did.

        Now… which of the 2 groups is larger? That is likely to depend on age.

    • Nick Franceschina
      • I hated that scene so badly! Even as a vim user who insists on spaces, it would annoy me to watch a person hit the spacebar. I would have shown her how to `:set ts=4 sts=4 sw=4 et` and been done with it. Then she can use Tab, Backspace, and Delete and it would work like tab characters. Problem solved, go make love.

  • Asqiir

    My guess is that that managers (or whoever employs in the company) feel more like they understand something when space is used than when tab is used. Because they never use tab themselves…

  • Xsmael The-Best

    To be honest i never bothered, i press tab, and my editor will decide….

  • Mark Zabel

    Quite a funny little survey. Three things …

    1) The author (statistician?) didn’t regress on age of the programmer. That’s different than years programming and might account for generational differences along with the general trend of salaries going up over our lifetimes.

    2) Nobody ever questions whether there actually might be a causal effect! That is, using spaces is a good career move. Was it tested? Or do we “just know” this, you know, like we “knew” the Sun revolves around the Earth for centuries it was obvious?

    3) It’s rare that people don’t form the reverse question either: Does a higher salary mold a person into one who uses spaces rather than tabs? Seems silly here, I know, but it’s easy to be fooled by more esoteric things that often occur in business.

    • Victor Villas

      The author pretty explicitly called out for more people to find other confounding factors and said that correlation doesn’t imply causation.

      • Mark Zabel

        Yes, the author explicitly called for other confounding factors, hence my point #1.

        Yes, the major point of the article is one “correlation does not imply causation.” Point #2 is the opposite. In the paper it’s more or less assumed that using spaces doesn’t cause higher (on average) salaries. But that’s an assumption too! It COULD be causation. (even though our gut reaction is that the two are not causally linked)

        Point #3 is what has been called “cause-fusion”. In this context, “Does using spaces cause higher salary or does higher salary cause using spaces?” (It’s of course possible that neither of those statements are true.) Another example might be, “Do white blood cells cause infection?” If we didn’t know the answer, we could easily be fooled that they do. Why? Because when infection is present, so are white blood cells. It’s only through deeper study that we understand that white blood cells arrive at the scene in order to fight infection. The “cause” and “effect” are not always easy to know.

        • Victor Villas

          I see. I may have misread the intent of your comment, clouding my interpretation.

          • Mark Zabel

            No sweat. The tone of my first comment must have been wrong. I love articles like this! Very fun!

  • a20

    Developers who use spaces are the types who will take the time to figure out how to convert tabs to spaces in whatever IDE they are using.

    They put in more effort than their tab-peers into learning nitty gritty details and therefore accumulate more knowledge than the tab-developers who just use the default settings that come with their IDE.

    Spaces don’t lead to better salaries.

    It’s the mindset behind that habit – that tenacious problem solving mindset – that gives them more experience and confidence for the same number of years worked and that’s what leads to the higher salaries. Space usage is just one of the many qualities they possess that show how deep they are willing to go compared to others who take the easy road.

    • Whaaaat?

      It takes the same amount of time to set your IDE/editor to spaces as it does to set it to tabs. The “easy road” results in most cases in “auto mode” which usually means apply existing standard.

      • Marti Nito

        I tend to use git format. I work with different IDEs on different machines and its a mess to keep codestyle at sync. so i stopped caring about it completely and just use a precommit hook.

    • Lisandro Mc Gough

      I find your premise rather weak. “Developers who use spaces are the types who will take the time to figure out how to convert tabs to spaces in whatever IDE they are using.”
      You might as well state that “developers who use tabs are the types who will take the time to figure out how to convert spaces into tabs (i.e., abstract implementation details away in order to get a representation of indentation levels)” to make the case for tabs if those devs got the better salaries.
      I would rather look into the correlation between hard-core good ol’ days’ technologies and the tab/spaces trends of the day, that might provide a better explanation.

      • mechler

        It makes sense to examine the defaults first, right? A lot of IDEs these days give sensible defaults based on language standards anyway, and finding the people that deviate from those might be a line toward finding real factors that separate one group from another.

  • Whaaaat?

    Spaces for Tabs is cancer. Everyone with half functioning brain knows that. It is generally well known that mediocrity and ineptitude leads to promotions and that’s probably what explains this difference. Also thumbs up for starting another tabs vs spaces war.

  • RC_RC

    We use spaces because the C++ code we write has to run on a ZOS mainframe too.

  • Bryan Oakley

    My theory is that there is a non-zero group of people that answered “tabs” who actually use spaces. They answered “tabs” because they either misunderstood the question to be “what key do you press to do indentation?”, or they simply don’t know that pressing tab actually inserts spaces.

    Further this group of people are probably largely inexperienced. Maybe fresh out of school or only have a few years on the job. Their salaries will be lower, thus lowering the average salary for “tabs” users. I would be interested to see if we took, say, 10% of the “tabs” responses from people with less than 5 years experience and switched them to the “spaces” camp, how the results would shake out.

    I base all this on the fact that there are several comments that seem to be from people who are confused about whether they are a “spaces” or “tabs” person since they press the tab key for indentation.

  • Bryan Oakley

    My answer to the debate is pretty simple:

    1 – if you are working on my project, you will use four spaces for indentation. End of discussion. I value consistency more than I value your ability to choose.

    2 – if I am working on your project, I will use whatever you tell me to use. I value consistency, and on your project your choice is more important than mine.

    • mechler

      A valiant standard, and one I highly endorse. More importantly though is the discussion about why this data yielded this result. Is something *wrong* with the data or the questions themselves? Is something wrong with the direction companies are going? Can we control for something else within the data to explain what this post is talking about?

      I’m all for having a solid and respectable stance in THE GREAT WAR, but this post is about something bigger and maybe more real/important, imo.

  • Tab Guy

    I use tabs consistently because it makes the amount of indentation configurable.
    That’s more important to me than making money. Maybe that’s the real reason!

  • Icho Tolot

    I used to be very peculiar about always using tabs… until I started to use IDEs. (Yes, that dates me.) Nowadays I don’t give a f*ck (just like the compilers for real languages) and let the IDE decide. I believe Eclipse and AndroidStudio and Netbeans and Xcode use spaces, no? Anyway, my salary is… very good, so they better do. 🙂

  • sagar patkar

    Shouldn’t the conclusion be “Developers, who make more money, use spaces instead of tabs”? The current one makes it seem like developers can start earning more just by using spaces instead of tabs.

    • Victor Villas

      These sentences convey the exact same information. You mind is building the causal relationship here, and it probably doesn’t exist in either form.

      • sagar patkar

        Thank you for pointing that out.

  • Steve Zagieboylo

    Until the last decade, most corporate source control systems did not support setting the tab width. Consequently, looking at diffs in source control used 8 spaces per tab, which is unreadable. Therefore, developers who cared about code reviews insisted that the teams use spaces instead of tabs. (And those who used mixed became pariahs. OMFG.)

    This correlates to higher salaries, because those who insist on code reviews are better developers. So there’s a correlation but not a causal relationship.

  • Ionut Botizan
    • The author explicitly mentions that 🙂

      >Correlation is not causation, and we can never be sure that we’ve controlled for all the confounding factors present in a dataset.

      • Ionut Botizan

        Yeah, a single phrase, with no additional explanations, in an otherwise pretty long article, which roughly translates to:

        > We know all this is irrelevant but we still published this article because we’re trolls and we enjoy an internet fight as much as anyone else! 🙂

        • Victor Stafusa

          They published that because (1) they saw the correlation, which was unexpected; (2) tested for many possible causes linked to other more mundane factors, but none of them explained the phenomena nor warded it off; (3) published the data in the hope that somebody else is able to figure out what the heck is happening here.

        • They said that correlation doesn’t imply causation. That doesn’t mean that this article is wrong. Maybe there is a good reason why people who use tabs are, on average, paid less and we just haven’t found out why.

          They basically published research about “what doesn’t cause it”, which is just as important as research about “what causes it”.

        • David Robinson

          One thing I’ve found interesting about the response to this post is the number of people who interpreted the title as implying causation. The title explicitly, and intentionally, says nothing about causation. That’s readers projecting upon it.

          Having said that, I don’t think the effect is irrelevant or meaningless, and I don’t think of myself as a troll.

  • Icho Tolot

    Maybe space people earn more because they focus on important parts of their code and not on whitespace. So maybe they deserve it.

    • Noah Kennedy

      Maybe, although I actually believe that legibility is one of the most important aspects of programming. For the record, working with high school students on my old FIRST Robotics team is what really hammered this lesson home. There is nothing worse than a group of junior Java programmers with no understanding of whitespace or legibility in general.

      • Icho Tolot

        I wasn’t advocating for illegible code… mine is perfectly indented, the IDE is taking care of it. Just don’t ask me whether the files contain tabs or spaces… I don’t care and focus on those parts of code writing that the IDE can’t do for me.

        • Noah Kennedy

          Same here. I used to fuss over tabs and whitespace, until I realized that I could ignore it all and press a button to have my IDE do it all for me after I wrote the darn program. I don’t see how this has anything to with tabs or spaces though. Most IDEs that I have used use tabs, so I don’t think that this is the cause of this discrepancy. I certainly do agree with you that it isn’t worth the time to fuss over this too much. I had a friend who would reject all of our GitHub commits if we had even a single whitespace character out of place.

          • Icho Tolot

            The word anal-retentive springs to mind… I suppose he is a well-structured mind and very much cares about perfection, but does he also care about his co-workers’ productivity? Or customer requirements — like deadlines?

            I would reject code that uses logical operator chaining instead of proper if clauses. It’s all the same for the compiler, but a hell of a difference for the reader.

  • grimmriffer

    I press tab, but the editor inserts (some) spaces. So, do I use tab(s) or space(s)..? Only one way to find out – convert my salary to dollars and consult the chart! Which was of course the point of the exercise… Uh, or was it…?

    • This is what every affective developer does. You use spaces. Not understanding what you described is what causes Directors/CEOs and the writer(s) of Silicon Valley (on HBO) to get it wrong.

      • grimmriffer

        Get what wrong? Salaries? I’ll be sure to mention in my next review that although I press tab I’m actually using spaces!

  • MakeItFair

    That last paragraph starting “Correlation is not causation” is the key. I would have thought that country would make a difference, but evidently that’s not it, given the charts. There might be some other hidden factor at play. It seems strange that just switching to spaces would raise your salary.

  • Megan Robertson

    So, does this mean that we need to change how we TEACH coding, and tell the students that they need to use the space bar rather than tabs when indenting?

    • I think it’s more important to talk about correlation and causation. It’s not the choice of indention that makes a difference in salaries.

      • Josh Grams

        Hear hear. For instance, what if this is just an indication that companies which pay more are more likely to have coding standards that require spaces? Or to have coding standards that talk about indentation at all? Or…something else entirely?

        • Errol Sayre

          Or even, which fields are up-and-coming… the whole equivalent experience vs age question isn’t addressed here.

        • mechler

          This is an interesting line. What if the result is tied more strongly to editor? Larger teams may more typically use larger licensed products (JetBrains, Visual Suite, etc.) which may have defaults (even per language/standard) that push groups of people in one direction or the other. IDEs being grouped into what defaults they use may be a way to model these groups together and they may share some skew toward company types or team-sizes (as someone stated above) etc.

        • “what if…”? That’s exactly what it is. “companies which pay more are more likely to have coding standards that require spaces” These well paying companies hire good developers. These good developers suggest standards. The companies let natural order happen. The outliers eventually fail.

        • External Carrier

          It could very well be the opposite. In my country, companies that pay more are companies where main activities aren’t related to coding. While on the other end, companies where their bread and butter is coding pay less. I’ve worked for both type. IT companies were really strict on coding standard while non-IT companies didn’t give a crap about it and didn’t even want to hear about it.

    • benlorantfy

      um no, use an editor where the tab button inserts spaces. Pressing the spacebar 4 times to insert a tab would suck.

    • G. B. Versiani

      Yes.

    • Do not confuse spaces with space bar. I’ve never seen an affective coder use the spacebar. Why? Because if you are affective, you don’t put up with inefficient tools, you modify them or make your own. If you can’t conform to space indention, it is a pattern that will also affect other areas.

      • Jordan

        I think you mean `effective`.

    • Jordan

      Actually, in some editors (like Emacs — which I use), when you press “tab”, it inserts 2 or 4 spaces (depending on your configuration).

  • Is there similar data for those who use vi vs. those who use emacs? 😉

    • mechler

      Gird your loins with regression models.

      Edit: Or maybe GRID your loins with regression models. Either way sounds fun.

    • Bryan Oakley

      There’s no need. Everyone knows emacs users are superior 🙂

      (dons flame-retardant suit)

  • John Dibling

    Interesting. I have a hypothesis. I use spaces myself, and have for many years – but I didn’t always use spaces. I used to use tabs, way back in the day when I only programmed for Windows. Later, I as started to branch out in to other operating systems such as Linux and embedded hardware, I switched to using spaces. Simply because spaces played nicer with a variety if IDEs and editors than tabs did. I still hit the tab key, but I configured the IDE to translate that in to spaces. So my hypothesis is that maybe there is an apparent correlation between spaces and salary not because using spaces mean more money, but the reasons why programmers use spaces. Perhaps programmers who use spaces have more experience across a broader domain of hardware and OS’s, and that breadth of experience brings with it a higher salary?

    • Meanwhile I have the opposite experience regarding IDEs/editors.

      Take a non-configured `vi` or `nano` for example. They force you to use 4x space to indent 4-wide in spaces but just work with the tab character as expected.

      The only major annoyance is web browsers due to their special “tabbing through forms” stuff.

      Other than that, I found that editors need “more work” to support tab -> space expansion. E.g. you need a better editor (even windows notepad supports tabs!) or a plugin.

      I’ve programmed on all three major operating systems for at least 2 years each. I used CLIs, IDEs and editors. Other than web browsers everything was harder for spaces users.

      • Mike Richman

        We get it: you prefer tabs.

        But come on… no professional programmer is using vi unconfigured, or nano *at all*, right?

    • Robin Munn

      That’s my theory as well: the more experienced a coder is, the more likely he is to have seen code edited by multiple coders with different tab settings, who didn’t think about their whitespace and just pressed the Tab key as many times as necessary to get this set of parameters / comments / whatever to line up on their screen. For example, I’ve seen code files where there was NO tab setting you could choose that would make all the vertically-aligned parts of the code line up, even though the original coders had clearly meant for these parameters to line up with each other, and those comments to line up, etc. But whether you set your tab settings to 4 spaces, 2 spaces, 8 spaces, or even *gasp!* three spaces (*reaches for smelling salts and fainting couch*), one part of the file would line up vertically but another part wouldn’t.

      There are only TWO ways to fix this problem:

      1. Tabs for indentation, spaces for alignment. https://dmitryfrank.com/articles/indent_with_tabs_align_with_spaces has more details, so I won’t duplicate them here.

      2. Indent ONLY with spaces.

      Both solutions 1 and 2 will solve the problem. But solution 1 has a drawback: if I use it, now I have to pay careful attention to which whitespace character I’m using! And I don’t want to have to pay attention to whitespace: that takes time and mental effort that I could have been using to pay attention to the subtle interactions between this class and that other class.

      And so, with some experience under my belt, I’m more and more coming to prefer solution 2 (spaces only), because it’s the only solution that frees me from having to pay careful attention to whitespace, and yet lets me line up parameter declarations in a way that’s easy to read.

      And extrapolating from my own example, where further experience has pushed me towards preferring spaces everywhere, it makes sense to me that more-experienced coders would also, on average, tend to prefer spaces over tabs, which would adequately explain the salary difference.

  • Carlos José Bercero-Castillo

    Spaces people only care about money, not code cleaness nor professional development.

    Did the survey asked for how many job hops they had or how often their code gets turned back by QA? I bet spaces would double tabs.

    Tabs people focus their energy on doing things right regardless of their salaries, while Spaces on seeking better job opportunities that pay more and tolerate mediocrity. That explains this.

    • mechler

      I agree that tabs are “doing things right” in the most pure sense, but the rest of this is just conjecture that amounts to being just plain mean. Good luck with this attitude. We have data to examine; let’s explore the real information for the answer.

      As an example, the guy just after you offered team sizes as a possible correlation through team-size being causal (possibly) with salary.

      • It’s a good point though. If you don’t care about your code you’ll just go with spaces since that’s historically used everywhere.

        • Victor Stafusa

          I saw just the opposite. People who don’t care about the code will hit tabs because it will ident automatically (not paying attention if it is right or not). Also, people who don’t care tends to have a huge mess of tabs and spaces mixed with no pattern whatsoever and either don’t even acknowledge this (they are all invisible space) or if acknowledged, don’t care about it.

    • G. B. Versiani

      No, using spaces have nothing to do with making money neither with mediocrity, or committing crimes…

      It is only an statistical conclusion: using spaces are related to better salaries. All the rest are just conjectures…

      In order to tell about mediocrity/bad coding vs. indentation, you need to show a statistical conclusion in this direction.

    • Bart Van Leeuwen

      Indentation has zero to do with code cleanness, and everything with readability for humans. As for professional development, the numbers do suggest the opposite, as do the coding practices in every company I ever worked for. Rather, it very often seems people who militantly advocate tabs are stuck in a highly theoretical world with little consideration for the practicalities of the real world.

    • Doktor Jones

      Just as the decline of US oil imports from Venezuela explains the decrease in pedestrian deaths from collisions with heavy vehicles or buses!

      http://tylervigen.com/view_correlation?id=10967

  • David Reed

    Suggestion:

    Size of “work team” may cause spaces rather than tabs to be preferred in code maintained by a group (who may have diverse tab stop preferences, ..

    Size of “work team” also may be causal with salary, because you need extra engineering skill to be highly productive when working with others closely.

    If you have proxies for work team size, it would be a good test of this hypothesis to look at correlations between space-use and team-size, and between team-size and salary.

    • > who may have diverse tab stop preferences

      Isn’t this an argument for tabs? Let the guy who prefers 2-wide be as happy as the guy who prefers 4-wide.

  • G. B. Versiani

    Spaces vs tabs is a matter of style. Tabs never format well enough if not all developers use the same editor, or agree with the tabs width.

    So, opposite to what has been said about laziness, people using spaces tend to have more discipline than tab ones, even more if working in a team. These guys tend to follow strict code styles, including “lint” tools to avoid common mistakes.

    Personally I never read a new code indented with tabs which was as good as ones with spaces… But this is a personal assumption and in order to affirm anything about quality vs indentation, I would need to make an extensive research such as the presented one.

  • Cullen

    I use spaces but prefer tabs, due to working in code bases that included multiple languages with multiple developers all using different indentation settings. It’s very irritating to try to understand indentation when part way through a function the indentation level (two spaces – four spaces, etc.) changes. If developers configured their IDEs to represent tabs as different levels of indentation (two-space tabs vs. four-space tabs) and used tabs, they could each have their preferred code style on their own system, when viewing code they wrote or code someone else wrote, but that’s not the standard anymore. I haven’t encountered any professional here in the states that uses tabs in a professional capacity.

    For the few that do you use tabs, they are likely also working with employees that prefer spaces, and very possibly even working in an org that universally prefers spaces, yet they continue to use tabs. I use spaces cause it’s the standard, and I value coordinating with people smoothly more than writing code exactly the way that I want. This mentality tends to lead to more forward progress and better relationships with co-workers and managers, which also leads to more promotion/better recommendations to another job. It’s a balancing act to touch into the details of code and come back out of them when needed. You have to do both, and if you’re the extremely detail oriented kind of person such that you can’t give up certain details, you also likely are more of an introvert or more argumentative, and likely have poorer relationships with coworkers, leading to lower pay, whether you’re more talented/skilled/valuable than them or not.

    If you’re getting into arguments with coworkers about spaces vs. tabs, you’re probably doing it wrong. You need to stuff your pride (or maybe more idealistic outlook, whichever it is) and get to a point where you can coordinate, even if that means making minor styling sacrifices. There’s only so detail oriented that’s worth making a stink over, and the worst form of indentation styling is mixed tabs and spaces within one code base. Both forms of indentation “break” if they’re mixed with each other.

    • > I value coordinating with people smoothly more than writing code exactly the way that I want.
      But then, why do you force me to view code [2,4]-wide instead of [4,2] wide? Other people’s preferences are one of the main reasons why I always used tabs. I used to prefer 4-wide indentation and I was fully aware that most people can’t stand it. Therefore, I used a variable-width character.

  • G. B. Versiani

    Spaces vs tabs is a matter of style. Tabs never format well enough if not all developers use the same editor, or agree with the tabs width.

    So, opposite to what has been said about laziness, people using spaces may tend to have more discipline than tab ones, even more if working in a team. These guys tend to follow strict code styles, including “lint” tools to avoid common mistakes. Personally I never read a new code indented with tabs which was as good as ones with spaces… But this is a personal assumption and in order to affirm anything about quality vs indentation, I would need to make an extensive research.

    Matter of fact, correlating non related data may be dangerous. It can lead to… some correlation! For instance, you could have related salary with drinking coffee/tea… What’s the conclusion? Does it matter?! So drinking a better coffee will raise my salary? If I suddenly start to use tabs then I will have a drop in my salary?…

    Maybe more useful correlations: working remotely vs. salary (approach being adopted by several companies), amount of space amenities vs. code quality (companies associate good space to work with productivity, is it?), etc.

    • Tab width doesn’t matter for “formatting well”. What matters is that someone who prefers 4-wide indentation doesn’t annoy someone who prefers 2-wide indentation. Next you’ll want to hard-code the syntax theme too, right?

      • G. B. Versiani

        No my friend, this is not what I mean. Remember that usually programmers have to deal with the code width as well… So people who uses 8 spaces for tabs will get in trouble if the code was created by one which used only 2. Things get a bit less problematic for 2 and 4 spaces, but it’s there too.

      • ondrej h

        It doesn’t really work that way. I often review code and the web tools we use (and are very popular) have a fixed size for a tab. Therefore I would have to get used to given width anyway.
        Also, what about pair programming?
        What really matters is to stop dealing with this pseudo-problem. If someone gets annoyed, it’s not the problem of the rules, it’s a problem of the programmer. If someone is too used to a specific style, it’s their problem. Consistency is more important than personal preferences.

  • Victor Villas

    I’d suggest correlating with a more specific question: do you change de default indentation behavior from your IDE?

    I find that most people just want to hit tab and modern editors will decide. Most will even detect if the current document uses tabs or spaces and will automatically comply. So people who uses tabs nowadays are either because they work on a project and have to adhere, or are the ones that are *really* in favor of tabs.

    Because lots of space indenters are just going with the defaults, I’d say that the actual factor here is being someone who’s mindful against default settings is correlated with smaller teams and lower salaries.

    • Bryan Oakley

      I changed the default indentation of my editor (emacs) about 30 years ago. Haven’t needed to change it since 🙂

    • Michael

      This is what I was thinking too. I’m glad I don’t have to write out a full comment now.

      • Michael

        I don’t think that default IDE settings plays a very big part, though. It probably just has to do with whether you’re contributing to a codebase that has its own convention about indentation (usually 2 or 4 spaces), or writing your own code.

  • Enrique

    What about the ones who only use command+alt+F?

    • Kyle Strand

      What is command+alt+F?

      • thisisthelist

        [F]lushes the code down the toilet.

  • Victor Sergienko

    “We need more pirates. When we had more pirates 200 years ago, climate change was never an issue.”

    • mithlond

      Or, for purposes of this discussion, a more relevant example: https://uploads.disquscdn.com/images/4a117d218db7855bd4cf0a3284e2c4e8b598457854400126b8020d593361c7c3.jpg

      via https://imgur.com/gallery/3B0pt3M

      On a more serious note, though, if it turns out that neither is causal to the other, can it be safely assumed that a third factor is causal to both?

      • Nurf

        Yeah, my bad. I get cranky when people complain my CSS isn’t working in Internet Explorer 2.

    • Victor Stafusa

      Your example could be answered by “the economical/industrial (r)evolution of the world made pirates obsolete and unfavorable economically, while that increased the emission of greenhouse gases which lead to climate change”.

      However, the problem here is exactly that they didn’t found such explanation for the phenomena. They tried a lot of them (countries, programming languages, etc), and it remained a mystery. Nobody here is telling that it has a direct causation.

      • Victor Sergienko

        Well, the variable is not in the dataset. Everything else is a speculation.

    • Right, so we can ask the question – what is it about those developers
      that makes them more likely to use spaces and also more likely to make
      more money. Both of those are attributes of the same developers, whereas the pirates thing is about pirates and climate change.

      John Dibling has a valid theory below.

  • Fragile Development

    Correlation ¬⇒ Causation, but interesting correlation over a large dataset nevertheless, which adds weight the the correlation a benchmarking company such as BlueOptima find with 36 metrics over 6.4bn data points: http://www.blueoptima.com/web/guest/ce?utm_source=StackOverflow&utm_medium=Social&utm_term=ArticleComment-Fr-160617-1731&utm_content=CE&utm_campaign=MainSite

  • jsphpl

    Surprisingly, no decision trees or linear models are needed to predict a flame war by the title of a blog post 😉

    • mithlond

      The click bait monster just ate your lunch break nom nom nom!

  • mithlond

    My wild conjecture:

    – spaces are easier to represent uniformly and consistently when rendered on the web (or anywhere else; a space is always a space, whereas a tab’s width is context-sensitive)
    – use of tools that present code on the web (github, BitBucket) has increased in recent years
    – companies, clients, and developers who try such tools and see their benefits are more likely to adopt them
    – use of such tools generally makes developers more productive, so they either get more freelance work done or command higher salaries than those who tend to use older, less-productive tools/workflows

    Or maybe the trendsetters and decision makers at companies that pay more are inclined towards Spaces for some other reason, so more skilled/valuable developers seeking those jobs are forced against their will to desert their beloved and far-superior Tabs. 🙂

    • Bing987

      That’s the whole point. Tabs may be faster, but spaces impart consistency to the code. No matter what display or operating system is used, the code looks right.

      • Kyle Strand

        What do you mean by “tabs may be faster”?

        • Bing987

          Really? I have to explain it? Okay, a TAB takes one key press and 4 SPACES takes four key presses.

          • Kyle Strand

            Um. That’s just not true. I don’t know of *any* modern editors that can’t be configured to insert spaces instead of tabs when pressing the tab key. Since tabs take up a variable amount of space, a variable number of spaces is inserted, corresponding to the number of character-columns that tab would have taken up.

            No offense, but there are several other comments in this thread that mention this fact, and even some comments mentioning how weird it is that some people who promote tabs don’t seem to understand that editors can insert spaces instead of tabs using the tab key; I was wondering if this was kind of a straw man, so I’m somewhat surprised to see that this is apparently the first you’ve heard of this editor feature.

            Since your previous comment indicates you understand the value of indenting with spaces, I hope you’ve found this discussion helpful, now that you know your tools can help you more than they apparently have been!

          • mithlond

            I use Atom, and that’s exactly what it does when I hit the Tab key: it inserts the number of spaces I’ve specified as the “tab” width in settings.

          • Bryan Oakley

            very few people actually press the spacebar four times. We use the tab key like everyone else. Most modern IDEs and editors Do The Right Thing when you press the tab key, entering the appropriate number of tabs, spaces, or tabs and spaces, depending on the configuration.

          • Robin Munn

            Really? I have to explain it? Okay, a TAB takes one key press and 4 SPACES takes four key presses.

            Every time the tabs vs. spaces debate comes up, someone misunderstands it to be about which key on the keyboard you hit for indentation. It’s not. It’s about which characters are inserted into the file when you hit the Tab key. (Or which ones are removed when you hit Shift-Tab, or backspace when the cursor is sitting at an indentation level.)

    • Kyle Strand

      Out of curiosity, since you recognize the consistency benefit of spaces, what do you like about tabs?

      Are you familiar with the idea of elastic tabstops?

      • mithlond

        I dislike tabs, actually. The “beloved and far-suprior” was tongue-in-cheek 🙂

  • What about an IDE that uses spaces, but you can hit tab to add 4 spaces?

    • Yuval Gnessin

      This. I struggle to understand why the tabs vs spaces debate continues when it’s practically been solved by our tools.

      • Kyle Strand

        The person I know who most strongly endorses tabs does so because he likes the idea that anyone can choose any amount of per-level indent they wish without modifying the actual file. This is of course impossible with spaces, where everyone sees the exact same layout (assuming monospace font).

        I don’t believe that this hypothetical advantage is actually that useful in practice, and in particular it wreaks havoc with any attempt to do vertical alignment between rows where one row has non-whitespace characters. Nevertheless, I at least understand why the idea sounds appealing.

        • thisisthelist

          I think it actually points out one of the big problems with usage of Tabs that aren’t auto-converted to spaces. Code files that retain tab characters inevitably have items spaced with *both* tabs and with spaces. When the tab-to-spaces equivalency is changed from one dev to another, stuff that was nicely lined up for one developer becomes a misaligned mishmash for the next.

          • Kyle Strand

            Yep. The fact that this happened continually on our project failed to persuade this particular developer, though.

          • thisisthelist

            Funny how that goes. At this point though, a divide between tabbers & spacers seems so petty when I’m just hoping the U.S. somehow narrowly avoids a self-inflicted nuclear holocaust over the next year or two. : /

    • Robin Munn

      Every time the tabs vs. spaces debate comes up, someone misunderstands it to be about which key on the keyboard you hit for indentation. It’s not. It’s about which characters are inserted into the file when you hit the Tab key. (Or which ones are removed when you hit Shift-Tab, or backspace when the cursor is sitting at an indentation level.)

  • Charlie

    The ALGOL heritage of the Bourne family of shells is particularly clearer with spacing, and unfriendly to tabs.

    This is far easier to read:

    if [[ $x == $y ]]
    then a=$b
    else a=$c
    fi

    Than is this:

    if [[ $x == $y ]]; then
    a=$b; else a=$c; fi

    The effect is magnified with deep nesting of control structures.

    An efficient developer is both clear and terse. Tabs are not friendly to these goals.

    • Molly Carpenter

      if [[ $x == $y ]];then
      a=$b
      else
      a=$c
      fi

  • Ender Localhost

    My point of view:

    Age it self and not experience might be a contributing factor.
    At least where I live there are a lot of older pople that due to the change on the job market over the past decades were forced to change from other lines of work to areas that are related or closer to IT and technologies. Some of these even ended up at IT jobs becoming IT technicians with less experience than others.

    This means that a lot of people dispite their lack of experience already have higher salaries because they already gave a lot to the company where they work at. And from my experience older people tend to use less shortcuts on computers.

    I understand that this might be too specific to explain the reason why people that use spaces earn more…
    But my point is to show that there probably are a lot of other contributing factors to this that are not taken into account here.
    So before we jump into a conclusion as the title on this article states we should probably dig further…

  • External Carrier

    What about the fields of activities of the companies?
    I would compare IT related company VS non IT related because non it companies pay more and are less likely to demand tab from there coder than IT companies are.

  • m2OnLin2

    A key group is missing: those who use neither a tab nor a space. I expect those make the most.

    • Adrian Smith

      &.nbsp;&.nbsp;

    • Kyle Strand

      Erm. What spacing would that be?

      • Alexander Simes

        New lines only, ha ha ha

    • Suragch

      Iexpectthosetomaketheleast.

  • camainc

    [ the sound of hundreds of underpaid developers quickly changing their IDE to use spaces instead of tabs ]

    • Bob Hope

      [ the sound of hundreds of managers quickly standardizing on tabs instead of spaces to cut costs ]

  • Sudhir Jena

    Somewhere I get a intuition that programmers who use spaces also constitute those who copy paste some part of code from public sites like github and codepen. Due to copy paste, managers conclude that they are more productive and hence highly thought of but such programmers are assembling software not crafting it. Programmers who craft code would use tabs most of the times.

    • not sure

      Why would that be the case? What makes you think that… While some copy-paste programmers will get futher in certain companies, they are usually the ones with bad managers and shitty pay. Which is why bad programmers can sneak by as ‘good ‘.

      • An0nym0usC0ward

        You’d be surprised.

        Especially in large enterprises, managers of software developers do not understand what writing code is about. It’s magic to them. They’re constantly surprised that it actually takes time, and that it can’t simply happen at the touch of a magic wand. They constantly suspect that developers are cheating, and that their estimations are beyond what time is actually needed.

        Such managers, having no clue about code, tend to look at signs that are relevant for a worker’s value in other fields, but which are more often than not bad in programming. You’re valued if you do overtime. You’re valued if you write many more lines of code than your peers. You’re valued if you’re constantly hitting your keyboard, rather than take breaks and stare mindlessly at the monitor. And of course, you get a better pay.

        I always say that in software at least larger companies are a way more convenient harbor for stupidity than smaller ones (but I have a suspicion it’s the same in other domains too). A small company cannot afford unnecessary costs. In large companies a source of unnecessary cost, such as an industrious programmer never thinking his code through and spending more effort on coding than necessary, may never get booted. A small company will quickly discover that what he delivers is more costly than what apparently lazier programmers, who take more time to think than to type, and boot him. Plus, large companies inherently are more prone to a higher density of stupidity – stupidity infiltrates everything, and there must be a constant effort to weed it out. Only, larger companies move slower, due to sheer size, and as a consequence stupidity has a naturally longer survival time there. This makes people with low tolerance to BS move away from corporations, leaving them with the more stupid folk in the labor marketplace. But it also means that BS-intolerant devs will on average get a lower payment.

        • Félix Gagnon-Grenier

          That is some convoluted bs right there…

          Welcome to 2017, where companies such as the ones you describe are slowly dying, and where the new sexy is having open spaces, time for reflexion, thinking, planning, challenging ideas.

          Welcome to 2017, where managers understand necessities of the internet, the dangers involved with online piracy, and the paradigm of programming.

          I can only wish for you to leave that sour space and see the new world, because what you seem to see right now is depressing.

    • ondrej h

      I use only spaces and I have never copy-pasted code.

      • Molly Carpenter

        Not even your own code?

        • Bryan Oakley

          I’m the same way. I don’t copy/paste code. I don’t use any sort of snippet manager, or have a file of commonly used chunks of code. Those commonly used chunks are in my head.

          Naturally I will sometimes copy and paste my own code, but even that doesn’t happen all that much. I write reusable components, but I tend to avoid literally duplicating code.

      • An0nym0usC0ward

        There are many situations in which copy/paste of tiny snippets makes sense. For example, when I have to provide an overloaded version of an already existing method, I always start with copy and paste of the declaration line. When I implement an interface, I sometimes prefer to copy its body rather than let the IDE generate the methods in the new class for me. I often copy setup code from one test to another – having extracted private methods for setup in tests introduces coupling and makes tests a lot harder to read. If you don’t do such things, you’re not optimally productive.

  • Molly Carpenter

    This analysis is problematic because it doesn’t account for cost of living differences that vary wildly in a country. A developer in San Francisco, CA doing the same job as A developer in Portland, OR would be paid more, but will likely not be living as well. The use of spaces and tabs broken down by region may behave similar to dialect differences between those regions. So those highly paid developers in San Fran may prefer spaces because everybody they know uses spaces and may be surprised that anybody uses tabs. I have a feeling that when one digs deeper it will be revealed that space vs tab use has little to no cause and effect relationship to “standard of living”. Gross vs net.

    • Archibald McNeill

      In what way would the cost of living have any effect on this? It seems that you’re going down the path of saying that there are some regional influences on whether a developer uses tabs or spaces, but somewhere along the way you try to tie in the cost of living in that region, which is completely unrelated. Your hypothesis would mean that for some reason, developers using tabs or developers using spaces would group together regionally, which has no backing unless you have some knowledge of their grouping that I don’t.

      I do however think that you’re on the right path in questioning the validity of this blog post. To me, it would make more sense if developers that use spaces were skilled in technologies that provide higher salaries. What would contribute to the higher space usage is if we found a correlation between technologies with higher salaries and the syntax with those technologies requiring spaces (or the education for those technologies encouraging spaces). That’s my two cents, anyway.

      • Molly Carpenter

        If you can keep more of your money you live better. Have the opportunity to save more and retire sooner. So getting paid more doesn’t help if most of that money is eaten by expenses.

        • Aaron Shumaker

          That would only have an effect on the results if there was a bias of people in different areas with different cost of living. E.g. if it were more common for people in high er cost of living areas to also use more spaces. It’s like saying, but what if all the people using spaces also get robbed daily by muggers on the street? We can reasonable assume there wouldn’t be a proportionally greater number of space users getting robbed than tab users.

          • Molly Carpenter

            A lot of our tech workers are in places like San Francisco and Seattle which have high cost of living. Also by extension higher crime rates.

          • Aaron Shumaker

            Yes there are people in different crime and cost of living areas. The point you are missing is that is an independent variable. It doesn’t corelate to space/tab usage. Reread what I said about “bias”.

            You are essentially claiming that if I live in a low income area, that I go to work and say to myself “Hmm, my rent is cheap, so I will use tabs.” and someone else goes to work and says “I pay alot on my rent, so I think I’ll uses spaces”.

          • Molly Carpenter

            Well I was leaning more toward space/tab usage being regional and how cost of living varies with region.

            I also saw a comment where somebody mentioned that space usage may be more tool related than anything. A lot of the respondents are working in web development and the tools tend to be hostile to tab usage.

            The data could be saying that web developers are getting paid more. It also could be saying that more web developers use stack overflow.

            The article implies getting paid more means living better. There simply isn’t enough data to determine if usage of tabs or spaces is really better for one’s bottom line.

    • OllieJones

      Ms. Carpenter’s observation points to an obvious question to ask of the data.

      Do the spaces and tabs people belong to different subcultures? Do the space cadets hang out at different bars and meetups and coffee shops from the tabsters? If there’s a big NYC or Mountain View cluster of space cadets, it could skew the stats.

  • Leyendlink

    Python LOL

  • Colm Bhandal

    Here’s a potential confounding factor. It relies on the fact that this correlation is just between what people answered to the survey, not necessarily what they do day to day. And people answering surveys tend to do so very quickly. What if the wording/positioning of the tabs vs. spaces question had an effect? For example, the word “spaces” is longer and has an extra syllable vs. “tabs”. Maybe the question said “What method of indentation to you use?” and the first answer was the lovely short “tabs”. Lazy people might have simply clicked on “tabs” without reading on. And it’s not hard to believe that laziness correlates with lower salary in the IT domain, where pedantry is rewarded.

    I’d like to see the actual survey, or a screenshot of that question if anyone has it? If indeed the question is phrased as “lazy person bait”, we have a potential confounding factor on our hands: laziness. We can’t tackle this confounding factor in any way other than actually reissuing another survey, with a question that’s purposely designed not to let the above happen. A lazy-proof question would be needed. Of course, all this is dependent on the wording of the actual question, which would be really interesting to see…

    • Pacerier

      What’s the technical term for this bias btw?

    • andrewarchi

      The question, according to the survey results, was “Tabs or spaces?” and the response options were “Tabs”, “Spaces”, “Both”, or “NA”. If they were ‘lazy’, then they would pick “NA” because it has the shortest character count

  • Commentor

    Nobody but the person who sets up the project should ever have to decide, because we have EditorConfig now. EditorConfig exists so the who-cares people can coexist with the we-care people. BUT… the problem is that the who-cares people don’t even care enough to install the plugin. It’s like knowing you can’t spell and refusing to use a spellchecker.

    • And some with a spellchecker will add words with incorrect spelling because they thought the original was wrong!

  • I use NO-BREAK SPACE just to mess with the browsers.

  • An0nym0usC0ward

    Tabs are obviously more flexible than spaces for indentation, and indentation is why tabs were created in the first place. Only, especially in large corporations, there’s always some furniture police at work favoring strict rules, most often conventional and without meaning, often counter-productive – such as spaces for indentation. Devs being willing to accept such brainless rules will work in large corporations in a larger proportion than devs having little tolerance for BS, and thus be better paid. That’s my take on it.

    • Victor Stafusa

      Tabs are a mess. Their size is highly context-sensitive and varies wildly from project to project and even within different files in the same project or even in different parts of the same file. Also, reading code idented with tabs in e-mails, browsers (like in github) is a painful experience. Having to define and redefine what the heck is the size of the tab over and over again is hell. To make things worse, many people mix spaces and tabs carelessly and don’t know how to properly ident the code, yet they produce code which you as a programmer will need to rad and/or mantain. IMO, THIS is counter-productive!

      • An0nym0usC0ward

        Nope. Tabs are not messy, as long as you use them exclusively for what they are meant: indentation. Using tabs for spacing too, or mixing tabs and spaces is indeed messy.

        You do not constantly redefine what size a tab is. You define it once for an IDE/mail reader/whatever, and then you always see everything indented the way you like, not the way the mail sender/another programmer likes.

        Go have fun looking over some code using a one space indentation level, or one using 16 spaces for a tab. With tabs, you don’t get to see such a thing, with no additional effort whatsoever. With spaces, there’s no way around reformatting everything.

        Look at it another way. You never press the space key repeatedly to create indentation, you use the tab key. What’s it to you, if there’s a tab inserted or spaces? The only real difference occurs when code is shared between programmers using different indentation sizes. Spaces force everybody to look at code the same way. Tabs don’t – they’re more flexible.

        Also, people who don’t know how to indent code, or don’t care to properly indent code will make a mess regardless of whether they are using tabs or spaces.

        Modern IDEs are making this a no-problem, anyway. Just format the code to your liking, and that’s that. Smart teams/setups have a version control hook to reformat to one unifying convention anyway.

        • Victor Stafusa

          “Spaces force everybody to look at code the same way. Tabs don’t” – That is exactly the reason why I use spaces. If I write code in some way, I would want that other people would see it in exactly the same way as I did when I wrote it. When somebody else writes a code, I would want to see it in the exactly way that the author saw when (s)he wrote it. I see no reason to do otherwise. I don’t want to lose time trying to figure out what should be the tab size, specially when working on multiple projects with different settings, because, frankly, I have no time to lose on this stupidity.

          Also, by browsing code in github, or receiving diffs on e-mails, there will simply have no IDE support whatsoever, and it would be better if I never needed it in the first place.

          Further, by “format the code to your liking”, that would be good in projects where there is only one person coding or if all the members perfectly agree with the formatting rules and are extremely zealous to not break them. Unfortunately, that is rarely truth for large projects – many developers are sloppy and we all need to interact with their code.

          I am personally already tired of getting git marking files as conflicted because somebody messed with identation rules.

          I am also already tired of getting cases where the same file is formatted half in one style and half in another style, possibly rendering it unable to be fully sanely presentable in any tab-size setting. By reformatting them, I risk to produce more git conflicts if any of my coworkers also change the file.

          BTW, checkstyle has a module to forbid tabs: http://checkstyle.sourceforge.net/config_whitespace.html#FileTabCharacter – and of course, if everybody was zealous and attentious about formatting rules, nobody would need a tool like checkstyle.

          And yes, I do press the space bar repeatedly if the IDE or whatever text editor I’m using don’t translate tabs to spaces automatically.

          Finally, it is common to have restrictions on line widths, and those are harder to be respected if people are free to set their tab-size to whatever they want.

          • An0nym0usC0ward

            Essentially, what you are saying is that you would like to enforce your view on how code should look on everybody else, and that you are tired of other people having different preferences than yours, and that you’d rather dictatorially enforce one convention alone, than try to find a solution that fits more than just you.

            Checkstyle … it’s enforced on one of the project’s I’m currently working on. It enforces javadoc comments, for example. But it is easily fooled. Guess how those comments look like, and how meaningful they are, in non-library code. That’s exactly the kind of stupid, furniture police like rules I was talking about.

            If you press space bar repeatedly, instead of properly setting up your IDE, you’re also of the opinion that programmer productivity should be measured in lines of code. Right?

          • Robin Munn

            Isn’t that precisely what code style guidelines are FOR, though? ALL the projects I’ve worked on professionally have specific code style guidelines so that the code written by coder A and coder B will look the same.

            So yes, having the project lead “enforce [his] view on how code should look on everybody else” is precisely what should happen. If the project lead has chosen to dictate spaces for this project, use spaces. If he has chosen to dictate 4-space tabs, use 4-space tabs.

          • An0nym0usC0ward

            The coding guidelines I have worked which have also made sense were prescribing things such as making local variables and function parameters final/const, the order of public/protected/private declarations in a class body, naming conventions and the like. Only a small part of them was dedicated to actual formatting. Even so, after many years of programming, I found that such guidelines are more often than not an unnecessary cost.

            But here’s the fun part: all were defining the indent size in one single place, and then defining further indentation-related rules only in relation to that that already defined indent size. Aside from potential violations of maximum line length, nothing will happen when using tabs instead of spaces, in relation to such bodies of rules.

            And here’s a funnier part: you pick some open source library, using two spaces for indentation, to customize and include in your project. You occasionally merge from the public git repo, since it’s only a small part that you need to maintain differently, but you do want to keep your code up to date with upstream. Only, your project uses four spaces for indentation. Good luck keeping your code properly formatted across the entire codebase. I’d rather spend time on something else than checking and fixing indentation after each pull – avoidable if using tabs for indentation.

          • Robin Munn

            Yes, that is a case where tab indentation is theoretically preferable to spaces, though there’s a trivial solution: EditorConfig. Configure that file to be 2-space indentation (you ARE keeping the 2-space indentation bits in a separate file, right? You’re not copy-and-pasting, are you?), and the editor plugin makes sure your edits in that file are kept up-to-date. And since you really should be using EditorConfig anyway, it’s not really an extra cost.

            But while in theory I agree with you that tabs would solve that problem, in practice I have nearly always found code intended with tabs to create more problems than it solves, because almost nobody actually uses tabs correctly. I say “nearly” always because I have seen precisely ONE project in my whole life that both: a) used tabs for indentation, AND b) did not suffer from mismatched-tab alignment issues anywhere in the project. (It was a two-man project written in Python, and if I could remember the project’s name, I’d cite it, because the authors actually Did The Right Thing™ and I would like to praise them publicly for it). All other projects I’ve ever seen suffered from mismatched tabs, even more often than the mismatched-space indentation that you mentioned. And if people were careful about only using tabs for indentation, and using spaces for any necessary alignment past the indentation level, that would be great. But in practice, almost nobody seems to get that right, so tabs result in an even bigger mess than spaces.

            So yes, in theory, I would like to agree with you and use tabs for indentation and spaces for alignment. But in practice, that just results in ugly code. At least with space indentation, you NOTICE when someone else has used a different indentation level than your default, and you can temporarily switch your indentation to match theirs. (You’re NOT going to put 4-spaces indents into that 2-space file when you edit a couple of lines, right? And you’re NOT going to reindent the whole thing to match your preferences, right? Both of those are *terrible* ideas.) And better yet, EditorConfig can do it for you.

            Trust me, I’ve been there, seen that code, got the misaligned T-shirt. All too often. And at the end of the day, spaces are the only way to ensure that you don’t get that T-shirt.

          • An0nym0usC0ward

            Your experience is different from mine. For many years I worked in a team that used tabs (and Allman, by the way), and everybody was very conscious about formatting. Now I work on a project where there’s one guy (highly appreciated) who is whole-heartedly against tabs, and who doesn’t give a rat’s behind on formatting. We also have checkstyle integrated in the project, guess what the effect is …

            If I take some other code and want to integrate it in my project as source code, not as a precompiled library, I’ll also want it to conform to my project’s coding style. For such reason I have encountered more than one project which stayed with ancient versions of code they took from a library many years ago – distinct formatting made merging of fresh versions a pain.

            Tabs vs spaces is a technical matter. Sloppy vs orderly programmers is not a technical matter. They are orthogonal.

          • Robin Munn

            Tabs vs spaces is a technical matter. Sloppy vs orderly programmers is not a technical matter. They are orthogonal.

            VERY true. Sloppy programmers can mess the indentation up with either tabs or spaces. If your team is doing indentation right and being careful, then tabs will work well for you. I’m glad you have such a team! (Well, except for that one guy…)

            Your second paragraph is a perfect illustration of why I find it unwise to integrate “foreign” files into your project in a way that changes the style of those files. I think it’s wiser to just put a comment at the top of the file saying, “This file comes from (name of open-source project) and is licensed under (license). It uses 2-space tabs because that’s what that project uses; do NOT change the indentation in this file to match the rest of the project.”

            Then if you ever edit the functions in that file, you make sure those edits use 2-space tabs, and K&R style (or whatever it has), and only in the files that you originated do you use 4-space tabs and Allman style. And you update your .editorconfig file to set up the rules for that particular file, so that you don’t have to remember to change your editor settings constantly as you switch back and forth between files. That gets you the best of both worlds: you don’t have to fiddle with your editor settings all the time, but you can still integrate any future changes to that file without running into tons of Git conflicts.

          • An0nym0usC0ward

            Good luck maintaining the checkstyle configuration, so it does not check the files from the foreign project you integrated but does check the ones you modified. (I for myself consider integrating foreign code this way plain stupid, and not worth doing. But I don’t get to always call the shots.)

            I’m not necessarily arguing for the absolute superiority of tabs. In a well maintained codebase in the hands of a disciplined team, using a modern IDE/editor, they’re almost 100% equivalent. If a team feels they like spaces more, I don’t have a problem with that. Only, I consider that all other things being equal, tabs are absolutely equivalent, except for added flexibility.

          • Robin Munn

            Since I haven’t used checkstyle before, I hadn’t thought of that problem. (I have been working in a .Net shop for the past decade, and have only ever worked on one Java project, in a different job. And that was back when I was a complete newbie so I wasn’t allowed anywhere near the build config at the time.) But a quick Google search turned up https://stackoverflow.com/questions/2362652/excluding-classes-in-maven-checkstyle-plugin-reports, which suggests that you can exclude files from checkstyle pretty easily. If that’s the case and I’m not missing any subtle problems, then it shouldn’t be too difficult to keep the original formatting from a file you pulled in from a different project, thus solving the Git conflict problem.

          • An0nym0usC0ward

            I never said it’s not possible. Only, as time goes by, you keep changing additional files. You either keep all the files you got from outside with a different format, and exclude all, preventing checkstyle from checking even the files you modified, or you keep fiddling with the checkstyle condiguration as you change additional files or the structure of the code in the foreign project changes. Neither is an optimal solution, IMO.

            Repeating myself: I think taking over a foreign library’s source code and modifying it in your project is so costly it is in most cases not justified. The more so since most libraries lending themselves to something like this also have reasonable extension points, and, if something is missing, the devs are more often than not willing to accept push requests. But I’ve seen it done, repeatedly, and it’s cumbersome at best. You really have to sell the effort to either very many customers or to very well paying customers, to make it worth, and even then it either slows you down or makes you use obsolete code, once code ages and you stop pulling in fresh versions.

          • Nick

            “When somebody else writes a code, I would want to see it in the exactly way that the author saw when (s)he wrote it.”

            I don’t, the size of a tab is am a personal preference. Maybe you like 2 character indentation, I prefer 4, I want my IDE setting to control that which tabs do perfectly. The issue is where people use tabs for alignment, that is a massive no. Spaces always for alignment.

          • That is great for languages not allowing you to break statements over multiple lines of code. As a result, if you use TABS, they have to be used for both indentation AND alignment and it simply does not work reliably between different toolsets.

            I suspect the pay difference comes from experience and developers with more experience have learned the evils of working with TABS in source files. NOTE: yes, some toolsets, like make, require TABS but that is a different discussion.

        • The problem is every IDE and editor STILL treats TABS subtly different forcing EVERYONE on a team to use the same exact editor to satisfy the needs of the one person thinking TABS are a good idea. Having the VCS do reformatting of code on a commit is simply a bad idea.

          • An0nym0usC0ward

            Using tabs for anything else than indent is plain stupid, and developers doing so are wrong. As far as indent goes, there’s really not much that editors could handle differently. Indent is indent and that’s it.

            I haven’t worked on a team using the same editor/IDE for years now. We never had any indent problem caused by this.

          • Desy13

            Using tabs in the first place is stupid and shows that you are just a fucking noob

          • An0nym0usC0ward

            I see. Your language and profoundly logical argumentation, on the other hand, clearly picture you as a very mature and level-headed person …

    • Tabs are worthless for indentation outside of one man band wanna be programmers. Once you need to work in a team of more than one where different editors might come into play, TABS have to be thrown under the bus because they can make code unreadable and seriously impact productivity.

      That’s my take on it.

      • An0nym0usC0ward

        That is pure speculation. I have worked on countless projects using tabs for indentation. We didn’t have any formatting problem. I now work on one using spaces for indentation, and constantly have to remind committers that their negligence re. indentation breaks the build due to how checkstyle is used.

        When developers with different preferences for indent size look at the same code in their IDEs, a web page from github or elsehwere, they are forced to see it as the original writer of the code wanted it to look, not ow they’re used to look at code. This makes them less productive. If tabs are used, each one can configure his own IDE to his liking, and look at code the way he’s used to. This impacts productivity positively.

        Given these facts (i.e. not speculation) I’d say your statement is more of a religious than of a fact-based, rational kind.

        The only argument for spaces instead of tabs that’s in favor of spaces, presented in this discussion so far, is that messy developers make a mess when tabs are allowed. That’s a non-argument – sloppy developers make a mess when tabs are forbidden too. The only advantage of tabs is that everyone can configure the tab size to his liking, something spaces can’t provide. There’s really nothing more to it. There really isn’t anything making spaces better than tabs.

        • Desy13

          Dude, you are an idiot. The only projects you likely ever worked is creating a php website for your grandma’s retirement home, because no serious company will hire you if you rape their code-base with tabs.

          Spaces look same. EVERYWHERE. Tabs don’t. They look “okay” for one, crappy to “other” and totally shitty for the “third”. Idiots like you, cause billions of damage due to low productivity

          • Bryan Oakley

            I really don’t think name calling makes for an effective argument.

      • Bryan Oakley

        I think saying “seriously impact productivity” is a bit alarmist. Lets be honest, a few misaligned tables or blocks of code here or there isn’t going to matter a whole lot. Still, given the choice between a few misaligned blocks and no misaligned blocks, I’ll chose the latter.

  • D B

    That’s not why tabs were created in the first place. They were created to reduce bandwidth when printing reports over slow lines, like 110 or 300 baud. They were not flexible as they were, initially, fixed to every 8th column.

    • Victor Stafusa

      No. They were created for typewriters and later ported to computer keyboards.

      • D B

        Gosh. I guess I didn’t use typewriters much when I was initially coding. I did use Teletypes and ASR33s though. Which had fixed tabs. Unlike typewriters.

    • Pacerier

      Citation needed.

      • Citation? Sounds as if D B, like me, lived this. Life? On slow serial based printers with 110 baud links you could only communicate 10-12 characters per second and printers could print fast than that. So TABS were used to speed up the communications of the data from the computer to the printer for forms and source code. Changing TAB stops, while theoretically variable with set horizontal TAB (ASCI 136 I think), was almost never used because it was not very universal and TAB stops were almost always alined on 8 characters columns. Vertical tabs were always 6 rows.

        This could cut your print time by 40-70%. It was significant on slow serial printers.

        Then the PC came and editors (like Borland’s Turbo Pascal) started allowing control of on screen indentation levels and TAB usage but every editor treated TABS differently. It became a mess and we are still living the nightmare.

        • SomeArchitect

          This is true. They were used to make printing more efficient, but they were created to assist table entry with typewriters.

          From WP so take with a pinch of salt.

          https://en.wikipedia.org/wiki/Tab_key

          He’s right when he says further down that they didn’t have fixed tabs, but tabs were clearly invented and used by typewriters then co-opted later for use in printing for compression.

  • Infiyaz Khalid

    If you considered multiple countries, how did you standardise salaries? A person earning USD6,000 per month in the US is the same as someone earning USD2,000 in India due to the lower cost of living.

    • AutoSniper

      They never said anything about standardizing salaries.

      • Infiyaz Khalid

        Then it is wrong to compare the salaries in their raw values against different countries.

  • What are you trying to say? And what advantage do I get, as a developer, from reading this nonsense?

    • What he’s trying to say is that developers called Billal are more likely to take a humourous light-hearted blog post incredibly seriously

  • Pacerier

    My understanding is that spaces are more Efficient because code is easier to read when compact (aka indentation hell).

    But there’s a problem with the analysis so far: you controlled by country instead of controlling by location (city).

  • One simple question to SO developer? Is this survey make sense at all?

  • Marc3488

    The “confounding factor” is simple.

    The question was: “Tabs or spaces?”, with options: “Tabs”, “Spaces”, “Both”, and “NA”.

    The majority of professional software developers use some sort of Environment (aka IDE) in order to be productive. I don’t suppose it’s too big of a stretch to imagine they use _modern_ IDEs as well.

    The vast majority of modern IDEs I know of will default to spaces for code indentation. If you hit TAB, it’ll just insert (usually 4) spaces in your file for you.

    When these professional developers were responding to the survey, they answered “spaces” because technically, that’s what their code is being indented with. It all comes down to defaults.

    I don’t claim ALL of the difference is accounted by this fact alone, but _most_ of it is for certain.

  • Rolf Howarth

    I just wish a text editor somewhere had adopted the only sensible way to format code: ALWAYS use physical tabs at the start of the line, one for each level of indent (and set your display tab stops to be 2 or 4 space or whatever you prefer) and NEVER use tabs at the end of the line when you’re aligning comments vertically.

    Regardless of what you type, the editor would never save a file with spaces before the first non-white space character, and never save tabs after the first non white space character. Trivial to implement, and that would solve all tab problems forever for everybody 🙂

    • Robin Munn

      The problem with that approach is that you often want to line up parameter blocks:


      int someFunction(string firstParam,
      int secondParam,
      SomeClass thirdParam)

      If you use tabs to line up those parameters, you’re going to mess up the alignment. (See https://dmitryfrank.com/articles/indent_with_tabs_align_with_spaces for details if you don’t yet know why “tabs for indentation, spaces for alignment” is the ONLY sensible way to use tabs in your code). Therefore, if you’re using tabs, you need to be able to use a mix of tabs and spaces in the secondParam and thirdParam lines: tabs up to the same level of alignment as “int someFunction”, and spaces thereafter.

      Which, in turn, means that your editor MUST be able to understand your language’s syntax. Which is extremely non-trivial.

      I would actually prefer tabs, as many others do, if they actually worked. But because it is almost impossible to get the necessary tabs-and-spaces mix right, and almost every editor gets it wrong, I end up preferring spaces because they’re the only thing that actually works, and lets me stop worrying about whitespace as I’m writing my code.

      • Symbiatch

        I use tabs and I never worry about whitespace. Why? Because it’s irrelevant. I don’t need to line up parameter blocks or anything. I write code. Editor indents and makes it as it should be. That’s it.

        But I guess this is the reason why people use spaces: overly obsessing about things that don’t really make much of a difference. And I’m the one with loads of OCDs. Fortunately not this one.

        So people should try it sometimes. Just code. Spend your time pondering how to solve the problem and implementing it rather than stressing about alignment of parameters or comments. Might help 😉

        • Suragch

          What is your salary?

        • Sounds like the some of the coders on my current project. I fail a code review in less than 5 seconds and give it back to them because blocks don’t align properly and they respond: “It’s only white space and doesn’t impact the comment.” So it gets failed again.

          Alignment maters for long term maintenance.

          • Robin Munn

            Alignment matters for long term maintenance.

            YES. You will read code many times more often than you write it — so take the time to make it readable. You will be a lot happier in the long run if you do so.

      • Nick

        I use tabs for indentation and spaces for alignment, one of my plugins for visual studio handles it for me automatically. Best of both worlds.

        • Robin Munn

          What plugin do you use? Because I’d love to find a plugin that does the right thing here:


          »---if (someLongFunction(firstParam, secondParam) == "Arbitrary value"
          »---....&& someBooleanConditionThatAlsoHasALongName)
          »---»---Console.WriteLine("No braces around this line");

          Above, »— represents a tab character (set to be four spaces visually since that’s what I prefer), and …. represents spaces (as it happens, four spaces since that’s the number of characters in “if” plus a space plus one parenthesis).

          I would expect something as sophisticated as, say, Resharper to get that right (and as far as I know, Resharper does get that right, though I don’t have my work machine in front of me to verify that). But unless the plugin knows how to parse your code syntax, you will either get two tabs on the second line, or one tab + four spaces on the third line, neither of which is the correct result. And since I’ve never found a plugin (short of Resharper) that did the right thing in the rather-basic use case of a simple if statement split across two lines, I find that “tabs for indentation, spaces for alignment” is not practical for me. Yes, it’s ABSOLUTELY the right approach if you’re going to use tabs at all. But since I don’t want to be made to care about whitespace, and just want to get on with coding, I have to use spaces-only since that’s the only one the editor won’t screw up.

          So which plugin are you using that does “tabs for indentation, spaces for alignment” correctly? That sounds like a boon, and I’d love to check it out.

          • Jerry Barrington

            Since you do that sort of aligning, you *already* care about whitespace. Nobody has to “make” you care.

          • Robin Munn

            Perhaps I was unclear. What I meant to say was that I don’t want to have to pay nit-picking attention to which characters I’m using for which section of the code. I care about the two parts of the if statement being lined up; I do NOT care about which characters are used in lining them up. Except that if one of those characters is a tab, then I HAVE to care, because the editor won’t do it for me. And that is why I prefer spaces, because it allows me to not care which characters I use. (Unless there’s a plugin that will actually do it *right*, but so far I haven’t encountered such a thing. Hence my request to Nick).

      • NumberMuncher

        Tabs allow users to vary the apparent depth of the indentation for legibility. They can be used when a block only needs aligned with other blocks on that same level of indentation, or when alignment is trivial.
        Use spaces when alignment is not trivial.
        Sounds like more environments need to be more flexible to that.

        Anyway, anyone who bothers too much with aligning whitespace anywhere other than at start of line is silly. Those alignments are more likely to change if code is tweaked or added or revised.
        Comment blocks should never be tacked on the ends of lines — but that’s how I work.

  • Gustavo Bandeira

    Yes, but if we use spaces, US will spend more on science and we will have more deaths by hanging, suffocation and strangulation! http://www.tylervigen.com/spurious-correlations

  • Arduenn

    I use tabs, but my editor always converts them to spaces.

  • AmagicalFishy

    This seems a little contrived, mostly because I think the simplest explanation wasn’t addressed. That is: Developers who use spaces instead of tabs are generally better developers. (Perhaps it’s because “developer skill” is a difficult thing to measure?) This doesn’t mean that using spaces actually has any kind of effect on your salary. In that same way, better cooks probably have more cast iron—but getting cast iron isn’t going to actually affect your cooking skill.

    • I think it has lots to do with experience. TABS are okay when you are a one man band and you never change toolsets but then… BANG… you are in a team and people are using different tools/editors and the TAB becomes a serious liability with sharing work product.

      • Darren Collins

        These are exactly my thoughts.

  • Marcin Kłopotek
    • NumberMuncher

      I think that’s why the blogger decided to “leave them out of many of the remaining analyses”. Most of them didn’t survive the first round of questions.

    • Tim Locke

      Tabs only for indenting. Spaces for separating tokens. Using tabs or spaces to align comments is silly.

  • This could be because more professional developers use modern editors like Eclipse that convert the tab key into spaces…

    • R

      Eclipse sucks. I use vim/neovim and it has all features of a modern editor.

      • AutoSniper

        Can you set conditional breakpoints and do you have an associated debug console?

        • Are you trying to say you don’t know how to “set conditional breakpoints” and/or debug your code without “an associated debug console” some IDE provides? #ShiversRunningDownMySpine

  • Bill.Linder

    Can we just say linter? I do not know about most other developers, but I use a linter for all coding. Said linter auto formats my lines, catches typos, logic errors, misspellings and other Stupid Human Tricks (SHT) we all do. I do not need spaces or tabs. Less format focus and more code focus. Surely I am not the only one.

  • Coinoleum

    People earn less because they are worth less. The insistence on tabs over spaces is a reflection of a poor attitude towards programming. A tab has several problems, most notably it can not be distinguished from a collection of spaces visually, without some aid, like an editor that marks them as spaces. They therefore render any semantic use of space problematic. Tabs also get interpreted variably for formatting purposes, potentially making code confusing, even when space is not semantic.

    Any developer who is not sensitive to these issues is probably not sensitive to other aspects of their code. They make code that has more errors, is inefficient, or hard to maintain as a result. Hence they will make less money.

    • Devil’s advocate: I don’t know if those tab problems you listed would matter much if everyone used tabs. You would know it’s tab just by looking. Unless the language you’re using has different meanings for tab and space other than white space, which could also have been prevented if everyone used tabs when the language was created.

      • Richard Hussong

        The problem with tabs, even if universally used, is that a tab does not always represent the same degree of visual spacing when interpreted by different programs or devices. It is not sufficient for everyone to use tabs; they must also set up all programs and devices that interpret tabs to interpret them the same way, something that may not even be possible. The great virtue of spaces is that, assuming fixed-width fonts, they are always displayed exactly the same way.

        • All right, that’s true

        • Christopher

          But if everyone used tabs, doesn’t the degree of visual spacing become a non-issue? Assuming the code is idented, it’s still going to look fine.

    • u8y7541

      My editor marks tabs so I can clearly see them.

  • Eliott “ReDeathRay” Castafolte

    Thankfully my tab key is a macro to 4 spaces when I’m in my editors
    Also, my editor transforms tabs into spaces whenever I open a file so that’s that

    • teejay_1987

      Any code editor / IDE has that feature, not just yours…

      • Victor Engel

        The data didn’t seem to control for this, though. I’d like to see a result for people who enter tabs but have their IDE change tabs to spaces.

        • teejay_1987

          I think that nearly no one enters 4 spaces manually (at least in normal conditions).

    • The Drupal community uses 2 spaces, which, IMO, is easier to read. Multiple nested indentations with 4 spaces gets ridiculous quickly.

  • Fields

    Well a recent study shows that developers using spaces cause about 8% rise in total costs of ownership with their IT due to larger storage space requirements. I use tabs because I care how much money my company saves from my responsible coding behaviour.

    • Study shows developers using tabs increase maintenance costs by 20% as other developers not using the same exact editor can’t read the source because of random indentation.

      Tabs should have been banned decades ago.

      • H4X!

        i like tabs. tabs are my friends.

        • Darren Collins

          That Shift key, though – total waste of time. 🙂

          • H4X!

            you know it. lowercase and underscores only 😉

      • Fields

        Good developers can’t get a good joke when they see one…

    • It makes sense to just use a single character (or byte). I use spaces since my IDE does, but I don’t know how this all evolved. It’s odd that everyone hasn’t coalesced to using the same method by now. I wonder if screen width had something to do with it, since wider screens are a relatively new development, and presumable 2 spaces would be nicer for narrow screens than tab.

    • KlingOn2K

      Switch now before you go broke !
      Tabs will burn a deep hole in your pocket. I will soon be making a DIY video for Youtube on how to pry out the tab key safely from the keyboard once and for all.

    • Jason Daniels

      please provide a citation.

  • zippeurfou

    @disqus_2fRP1wjI8f:disqus I feel like the main reproach here is comparing the median rather than the distribution (using a proper statistical approach to see if there is any significance).
    I also added a similar chart for the IDE because some people were asking for it but I wouldn’t draw any conclusion from it as the sample size for some of them is really too low. https://uploads.disquscdn.com/images/4663aa97fa28f0ac30c146ee328ac8f8e57023a52278a465e25539e7b5386d23.png

  • Sir_Brizz

    Now do this for word wrap.

  • utsav

    Are we really discussing this? Dont we have code to write?

    • Jevgenija Karunus

      Did you really write this comment? Don’t you have code to write?

  • NumberMuncher

    28,657 survey respondents, apparently excluding those who answered NA. Within that group, you have exclusively defined subsets of 40.7%, 41.8%, and 17.5%. Then you mention a subset of 43.4%, which is fortunately where you focused your comparisons. Why bother telling us anything about those 16,231 who were excluded from further analysis unless you meant to compare them later?

    Anyway, sure this was meant to be more humorous than useful, but it might help if people knew why. these numbers say nothing about whether a person who suddenly changes to using spaces will make up the difference in salary any time soon. For all we know, a person who has been using spaces because they love them has a certain mentality which is favored over someone who has been using spaces for the same amount of time but only because everyone else wanted it that way.
    Maybe they skewed the numbers.

    Interesting to see that the slope of the Tab-users is less variable than anyone else. I see two inflections in the Spaces line, and one in the Both line.

  • A lot of this, at least as relates to open source, is largely driven by community standards. For example, the Drupal community has fairly strict coding standards that among many other things requires two space indentation. The result is a very readable codebase across the entire community. Those that don’t adhere to that standard will not have code accepted into the contrib space and thus will be less likely to be hired by folks like me (I’ve been around for 13 years in the Drupal world). That would naturally skew salaries.

  • Jim Sykes

    Should be obvious. The code monkeys are paid by the byte.

  • Michael Hardy

    Among those who stated their incomes, incomes were higher among those who used spaces. But suppose getting a high salary and using tabs is correlated with not wanting to tell people how much you make. That would skew the results.

  • Mustafa Atalar

    Here is my approach based on psychology: Tab users like/need more space, larger areas. Space users can see the same thing in smaller area. This state gives a clue about psychology of both type of users. Tab users probably need more time, more office space, and larger screen monitors and mobile devices, which means more cost for bosses. So they are not preferred compared to space users. If this approach is right, we have a new thesis: Tab users are more relax and happier people. So health costs are less, but bosses solve this issue with heath insurance. I also want to k now what is the condition of non indenters?

  • Fields

    I don’t get how this sterile discussion can make its way into studies… It’s the same as discussing opinions… because it’s exactly that: opinions. And opinions are like ass holes: everybody has one. And how can one ass hole be better than one other? You’ve got much better studies to care for, honestly.

  • MoreMozart

    I’ve been coding for over forty years, in that time I have used at least a dozen different editors. I use spaces for indentation, because tab settings have to be configured and may change when the editor changes, or if I am editing on a co-workers machine, or I am online using a client’s machine, or I use some software to print my code, or whatever. I don’t want to look up how to configure tabs to make my code look right.

    I rely very heavily on indentation to provide clues to nesting, in all languages (it is required in Python). Including in assembler. I like my code to look exactly the same no matter what software interprets the file. So I forced the habit of not taking advantage of any short cuts with a tab key. Spacing is second nature to me and I don’t have to think about it or count spaces or anything else. It produces consistency in the code and to me makes it easier to debug; in fact I consider bad indentation in my code to BE a bug, even if the compiler (or interpreter) is not affected by it. It is a bug in supporting the future maintenance and understandability of the code.

  • cminsanjose

    I am retired. I preferred spaces rather than tabs in the various languages and type of code I produced. Tabs cause indented code to move to the right too fast. Code scrunched up at the right margin not only looks ugly but is less readable.

    • Constantine Kharlamov

      …unless you figure that there’s a single metric “indentation size” to which spaces and tabs should conform, effectively making them indistinguishable.

  • Until further evidence comes to light, I’m just going to assume that this is the result of the most productive programmers breaking the tab key on their keyboard from overuse and switching to spaces to compensate. 😉

  • D. Michael Martindale

    It’s because developers using spaces don’t have to waste time scrolling right to see their deepest indentations.

    • Most editors **and** browser allow you to adjust the depth that a tab has. So basically you can have an identically looking source file using tabs though. But spaces do have just a more unified representation, not suffering from user dependent settings and it does not matter if you view the code in your editor or on i.e. github.

      • Victor Engel

        Exactly. Not just github, but many tools will default to a specific spacing for tabs, which may differ from what’s used in the editor. By the way, I don’t see an option for my use: using tabs and spaces, but having my development platform convert tabs into spaces. How the spaces are entered doesn’t seem that relevant. Having spaces in the code is more relevant.

  • LOL. I imagine people here know the survey is about the characters that is saved, spaces(0x20) or tabs(0x09). And not about the key which is pressed, which is the TAB key for most programmers (spacers or tabers). I can imagine that can exist a few programmers which press space a lot of times, but they are really a few.

    • Bones Justice

      If there’s one thing the tabbers and spacers should be able to agree on, it’s that anyone who indents with the space bar is doing it wrong.

      • An0nym0usC0ward

        Not really. If you go through the comments, you’ll find that some, although they know where the tab key is and what it does, actually press the space bar repeatedly – with pride! Given the many completely stupid things that often go on in corporations, it’s probably corporations where they fit in perfectly – hence higher salaries for space pressers.

  • Martin Ekelund

    Did you consider age in this? Maybe older professionals have kept their old habits using spaces… and usually they earn more?

    • Patrick Günther

      But my gut tells me that older professionals would be more likely to use tabs, since they come from an era, when storage capacity was more expensive.

      • Good point. As a note aside: some of us “old guys” often make the individual IDE auto-convert each single tab into several spaces on keypress. Spares you several keystrokes… and shows the “older generation” (read: 10+ years coding peeps) may still hug old habits, but it keeps evolving (whenever it makes sense).

      • Jason Daniels

        While certainly affected by language of choice, “Tabs vs Spaces” is an age old debate going back decades, prior to my starting college in 1989. So I disagree with your gut feeling. I see it more as an extension of the “Which programming language is BEST” debate. Which, itself is born of the same mentality that pits Superman against any number of other Superhero’s in imaginary fights. (Clearly Sarcastro would win.)

        There is a lot of dogma on both sides. This debate still rages on in message boards today, and hasn’t really broken any new ground in a long time. This article was just another more of the same data point in that fray trying to use the allure of and easy, but totally bullshit, way to get more money to sway people to one manner of coding, instead of getting them to intelligently use their brains, the real cause of getting more money.

        In reality, the most effective way to program on your own is that which a) aligns with your preferences AND b) you can maintain easily at a later point in time. In a group, it’s that which the group can maintain with least effort at a later point. However…

        The more members on your team, the more consistency in the coding starts mattering more than any of the pro’s and con’s of any one approach. Furthermore, self-inconsistency always takes more time for people to process, comprehend and act on. (i.e. tabs and spaces used with no easily discernible reason for the change)

        It’s my opinion that the reason I’ve seen large groups implode when not just automatically enforcing a formatting standard on code check-in, is that you get divergent personal preferences. Trying to make people remember to code in manners counter to their brains wiring ultimately creates discomfort, and eventually strife in the group, which is never productive.

        If a tool does it for you before check in, you’re allowed the freedom to make decisions that align with your own preferences, without impacting the end codes consistency, on check-in.

    • Jon

      He writes that he controlled for “Years of programming experience” which seems more relevant than age (lots of people start programming late in life and adopt the practices of new programmers regardless of age).

      • Typing is not programming, and how you type is influenced by absolute age and total experience typing, not only by experience in programming.

        • Jon

          That’s Interesting point, but I’m not sure I follow the logic. What is the conclusion you’re drawing from “absolute age and total experience typing”? That those people would use spaces or tabs or just that it’s totally irrelevant?

          I can imagine the oldest of typers probably learned on mechanical typewriters where they likely used spaces for indenting… but by the time _anyone_ starts to learn programming it must have been a long time since those days.

      • An0nym0usC0ward

        I wouldn’t say I’m a young programmer, with almost two decades of coding behind me. I prefer tabs. (And I’d also say I’m quite well paid, but maybe I’m just a statistic anomaly.)

    • Félix Gagnon-Grenier

      From where does this idea of younger devs using tabs comes from?

  • Ethuil UI

    I will be honest, tabs and spaces difference is so irrelevant in my mind, that I only realized what this article talks about half way trough. I was sure this is about difference when using workspaces or alt tabbing, thus tabs and spaces. So, yeah…

  • Jon

    I think it’s this… the higher paying languages like Rust, Clojure and Go favor spaces, therefore those programmers even when programming in lower paying languages like JS and PHP still use spaces. Being generally higher paid is what skews things up and down the graph. It’s likely a Rust developer is going to do a little PHP on the side, or in the past, but is not going to take a 50% pay cut and switch to tabs doing it… It’s unlikely a PHP developer using tabs is going to do a little Rust dev on the side, or in the past, nor that they’d charge 50% more and switch to space if they did.

    • Rogan

      lower paying languages, like JS? Don’t think you’ve seen the salaries a lot of JS devs get paid.

      • Jon

        I’m just going by the data in the chart here…

        For what you’re asking you’d want a chart represented with ranges on each language, but that’s honestly extra data not needed for this chart to illustrate the point. There certainly are JS devs (and PHP devs for that matter) getting paid 100k+, while there are others getting paid < 25k. Being a very flexible languages they're not at doing the same things with it, but it is weighted toward the low end. Keep in mind the dataset source. This isn't scientific survey of the industry survey, it's a self-reported survey of stack exchange users. Welcome to fun with statistics…

    • Except that Go favours tabs; it’s what gofmt uses which every vaguely experience Go developer uses to format their code.

  • Y

    What was the salary of those who didn’t answer the question?

  • Srivathsa Kalale Nadaddur

    Quite a revealing fact. I use spaces, because i want to be in control.

  • Beyond the tabs and the spaces, it’s pretty nice to see the difference (as usual) in anual salary in different countries.

  • Ffs… Did you check their “age”?

    Older people use spaces, younger ones use tabs. Regardless of programming experience, absolute age is the factor here.

    • I didn’t know that! Is that one of the results from this survey? (I haven’t checked the raw data yet.)

    • Dirk Durka

      Level of experience was controlled for. Provide data please.

  • Aleksandr Tokarev

    Big software companies enforces using spaces, because different tools displays tabs inconsistently by amount of white space, depends upon tools you are using you may dislike results. In case of spaces, results on screen independent of tools. Those developer usually have big salary. Be a developer in big company, you will use spaces, and get big salary.

    • Youda

      That’s just misunderstanding the point of tabs. Every reasonable text editor and IDE offers an option to set the width of tabs. And some people preffer to have the indentation to be wider and some others to be narrower. Using tabs allows everyone to be happy WITHOUT CHANGING THE CODE, just by changing the settings. If all used tabs, the world would be much better place to code in! xD And by the way i work for quite a big company and we use tabs.

      • Aleksandr Tokarev

        You sometimes restricted by tools. You not always have ability to watch on code via your favorite editor. When you do diff with company source control, or see history of the code those tools usually don’t have option to set width of tab. If you see code of other team via web. If do code review. On build machine you don’t have other tools except notepad, and usually you don’t have time to set settings if build failed and you need fix/resume. Of cause, when you write code you use your favorite IDE.

        • Youda

          If everyone participating on the project uses the same indentation, there cannot be problem in diff. Moreover tools are improving over time, graphical extensions for git already allow to set width of tabs, browsers already allow to set width of tabs. Only people who use older tools will have problems with tabs.

          • Aleksandr Tokarev

            People use tools, which they want incl. old, or new but without tab settings. Not all tools has tab settings, Sometimes they restricted to use a specific tool, which does not have tab settings, but tool is useful and integrated with dev infrastructure. And tab settings for all devs are different.

  • emrah

    This means nothing. You can get any result from surveys. It is mathematical trickery.

    • D Foster

      This article should be presented as a case study in how to lie with statistics.

      • Dirk Durka

        You realize you have to actually back that statement up with a refutation based on the raw data, right?

        • D Foster

          Were I making a case, and not merely stating my view, yes—that would be true.

          I suspect that most agree that the claim is silly enough to not need formal refutation. Those who do not will need to look elsewhere for that. I can’t claim to be that interested.

          • Dirk Durka

            Ok well in that case, your original comment should be presented as a case study in how to lie without statistics 😀

          • D Foster

            Or as a study in making an elliptical comment… and how one might be misinterpreted..

  • Layne

    Love it! Glad Germany is closing this critical gap.

  • Tiago Celestino

    I started use to tabs in my actually work, but I keep using to spaces on my personal projects.

  • Neithan

    How about (me, for example) using 2 or 4 spaced tabs to prevent repeating keystrokes and let the code formatter convert it to spaces? Tabs are like variables; if my team wants to use 3 spaces per indent, I modify it and… ta-daa

    • beets

      That’s ‘using spaces’.

      • Neithan

        That’s not the key I’m pressing though. And way easier to navigate within tabs than spaces. And who wants to “clack clack clack…” with the space key?

        • beets

          That’s the point, you don’t. You have your editor convert tab to space for you automatically. No-one (sane) actually presses spacebar for indentation…

          • Actually no one (sane) should do much identitation by hand anyway… your editor and your linter do that for you.

          • Neithan

            I must be seeing plenty of crazy people from reputable youtube channels blasting that space key then.

        • Félix Gagnon-Grenier

          Using spaces has nothing to do with the actual key you press, it’s about the actual character, or representation of character, on disk. Do you really believe all space users use the space bar?

  • beets

    Reading the comments, I’m beginning to think a big reason for the discrepancy is that less skilled individuals that actually DO use spaces will tend to answer ‘tabs’ because they press the tab key on their keyboard for indentation and don’t realise they should have answered ‘spaces’. This means those less skilled developers, instead of contributing evenly to each pool, actually are skewed towards ‘tabs’ and lower the average pay rate of ‘tabs’ vs ‘spaces.

  • Pena

    What about whitespace programmers ( https://en.wikipedia.org/wiki/Whitespace_(programming_language) ). Are they all millionaires?

  • Jason Daniels

    Correlation is not causation. This article implies, certainly with the last statement, a causal relationship. As a data scientist the author is in a position to know better than to make such statements. It’s disheartening that he chose to do so.

    Furthermore, the reason I PREFER spaces is it retains the original presentational intent, readability and therefore comprehension.

    However, the cause of my better than industry median salary is not that I use spaces, but rather I think about why things are done, and stick with proven, measurably superior results. What is measurably superior than either tabs or spaces, for overall results is keeping coding styles consistent within a file, and application. This is far more effective than dogma (i.e. spaces and tabs both have pro’s and con’s). That means for the sake of a project, and my peers, I eschew my personal preferences so that other developers can stay productive by not having to reattune their brain to a different method of code formatting for just the parts I worked on.

  • Nosferatu

    No offense, but don’t you thing that the tool used for development is responsible for the tabs, especially if you code in Python?

  • Steffan Perry

    Sure it has nothing to do with age? I.e. Old developers who are in senior roles use spaces, but younger junior devs use tabs?

    • Jason Daniels

      I know many well paid senior developers who prefer tabs, for many of the holy war reasons. I also know plenty of junior devs who prefer spaces. So age isn’t a relevant factor. REASONS for use are most relevant, and not at all addressed by this poorly constructed survey. (i.e. The participants opted in, they ignored a statistically significant number of respondents. They only talked about medians, not how the distributions looked, and implied causation, a horribly irresponsible behavior for a statistician or scientist. A Data Scientist certainly knows better than either why these methodological errors are significant and mean this article was a waste of space.)

      • forresthopkinsa

        Waste of space? That’s kind of extreme. I don’t think anyone is suggesting causation, but it’s *interesting* either way.

        • Jk

          “Waste of space” pardon the pun

        • Jason Daniels

          All he added to this myopic debate, was a spurious correlation. Causation was at least flippantly suggested at the very end. (“Though for my sake…”) On top of which, through his entire article, he actively fanned the flames of a debate with all the merits of arguing about putting pineapple on pizza, or forbidding such an act. (I’m in the forbid camp…) So yes. I stand by “waste of space.”

          • forresthopkinsa

            lol, the “For my sake” was a joke. Goodness man, lighten up!

    • Jacob Lynn

      This question seems to be addressed in the very first figure in the article.

  • Oohhh… so that’s why I’m underpaid!

  • Oudamseth Samin

    Now, it would be more interesting to do a salary analyst for developer who use Mac vs Windows.

  • MobsterSquirrel

    What about converting tabs to spaces? Do I also get more $$ in the end of the month?

    • netplayground

      No more $$ and fewer free hours as well I would think.

  • Dmitry Dziuba

    How you treated the problem that for all users, 42.9% used tabs and 37.8% used spaces, while in “provided salary” group numbers are correspondingly 40.7 and 41.8? It means that significantly more “tab users” hide their salary than “space users”, potentially leading to a misleading conclusion.
    Why hiding salary correlates that much with tab/space metrics? Were you able to identify some other abnormalities?

  • laoinjo

    Isn’t this due to what language you use? Cobold, C programmers generally don’t indent, and their average salary are higher than C++, C# and Java programmers. Also indention is more common in frontend languages than they are in backend languages, and backend developers are paid more than frontend developers…

  • laoinjo

    I knew it, Python was created to keep the salaries down.

  • Bysiur

    Or maybe those using spaces are less reliable and they tend to lie about their wages? 🙂

  • Only millenials will know arrows and tabspaces can be brought together…

  • Dan Harvey

    Being mostly a contractor I use whatever the local “code standard” is at the place i am working. 😀
    Good to know i can ask for extra if i have to use spaces lol.

  • malkia

    Please make a study comparing developers using arrays with base index 1 vs 0. It would be a fantastic addition!

    • Jack

      Or, you could use a language that allows one to have the base index any integer! 😀

  • Ben Griffiths

    Clearly the survey respondents are fortunate enough not to be employed by nincompoops who reward them on the basis of LOC produced, and instead are getting paid by the character…

  • dreaddy

    Agressive people like to hammer on the space key to keep their focus.
    More agressive people get a better salary.
    simple… must be it 😛

  • David stellar article! Interesting how about the percent of amount of people using spaces & tabs are about the same at 41%. Also interesting about the salary difference.

  • vurso

    Everyone knows you can leap further with tabs! #froggerlife

    • netplayground

      apparently you end up jumping past GO and don’t collect $200.

  • D. M.

    Statistics NEVER paint a false picture and unverifiable claims MUST be true under every circumstance. Every “data scientist” knows this.

  • Tejay Cardon

    Clearly the title is just backward. It’s really that higher paid (and therefore more talented) developers know that spaces are better. 😉

    (lest anyone start throwing rocks, I hope the sarcasm is evident)

  • netplayground

    In the final analysis everyone is overlooking one thing: A space is simply a tiny tab. So, everyone prefers and uses TABS whether they are willing to admit it.

  • EddieTechie

    This is simultaneously both hilarious and intriguing.

    I’m surprised no one mentioned this scene yet: https://www.youtube.com/watch?v=SsoOG6ZeyUI

    • Anil Gulati

      See… she is right, and he IS wrong. Tabs will make a larger file size, but bytes don’t matter if the file doesn’t even RUN because of a different tab setting that screws consistent indentation in the interpreter. If you have a stable environment you can trust an expander to auto convert your tabs, but then he’s clearly not conversant with good practice because he expands his tabs to 8 spaces! It was really obvious something was wrong when confirmed he was using Emacs instead of Vim. She’s better off without him. The reason you earn more using spaces … is because spaces are BETTER.

  • Nice one myschoolzone.com.ng

  • Robin Munn

    Evelina Gabasova has done a more complete analysis, and found that by simply looking at the median salary, your analysis was missing something. Specifically, the salaries of space-using developers had two peaks. The highest peak in the salary graph for spaces and tabs was right in line with each other: no significant difference. But there was a second, lower, peak in the right-hand half of the graph, where a significant number of space-using developers were clustered in a higher salary bracket, while developers who used tabs (or who used both indentation styles) showed no such second peak. Here’s the relevant graph:

    http://evelinag.com/blog/2017/06-20-stackoverflow-tabs-spaces-and-salary/salary_distribution_junior-1.png

    When Evelina Gabasova analysed the results further, she found that those developers who had higher salaries were strongly associated with three factors:

    * Using spaces for indentation, not tabs or “both”
    * Using Git for version control, not SVN or Team Foundation Server
    * Contributing to open-source software

    Read the linked article for more details, but it seems to me that the causal factor is probably somewhere in the “Contributes to open-source software” realm. I.e., people who contribute to open-source software tend to be more passionate programmers, and therefore tend to be more skilled, given the same number of years of experience, than their peers who don’t contribute to open source. And it also seems likely that most open-source software uses Git, and that most open-source software uses spaces for indentation rather than tabs. (The latter is my intuition, and would need to be verified — but it matches my experience). And therefore, if someone contributes a lot to open-source software, they probably have gotten used to using spaces, and also they probably have become better programmers than those who have only contributed to their employers’ projects (because they have acquired a wider breadth of experience).

    So apparently, it’s not that spaces give you a higher salary. It’s that contributing to open-source software gives you a higher salary, and contributing to open-source software makes you more likely to prefer spaces over tabs. And thus, the correlation is explained.

    • Robin Munn

      P.S. She also mentions a correlation with using PHP, but never expands on it in her article, so I can’t tell the size of the correlation. I have therefore left it out of my analysis above.

  • Yitzchok Ginzberg

    What about devs who hit TAB but have it set to expand into spaces?
    https://stackoverflow.com/questions/234564/tab-key-4-spaces-and-auto-indent-after-curly-braces-in-vim

  • swarchitect1

    my hypothesis: the higher salary comes from their social skills. They take into account that different team members use different editors and only with spaces it looks correct on all of them.

  • Farid Bonawiede

    Run this discussion with your team? Fork the discussion and have it with your team!

    https://blog.delibr.com/tabs-vs-spaces/

  • Fahad

    This only proves one thing. People who use spaces lie about their salaries.

  • Andrew Gallant

    That extra salary goes towards paying off the extra effort it takes to use spaces instead of tabs >;o)~

    • Franklin Fotang M

      Best comment!