Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Programming The Almighty Buck

Developers Who Use Spaces Make More Money Than Those Who Use Tabs (stackoverflow.blog) 515

An anonymous reader writes: 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. 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.
This discussion has been archived. No new comments can be posted.

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

Comments Filter:
  • by drnb ( 2434720 ) on Thursday June 15, 2017 @09:43AM (#54625443)
    Pied Piper proves it too, that tab loving company is one money losing screwup after another.
  • by TFlan91 ( 2615727 ) on Thursday June 15, 2017 @09:47AM (#54625467)

    "considered themselves a professional developer" ... "with 17.5% using both"

    wtf? a professional developer uses both? really?

    if and when i find a file that has mixed spaces / tabs, not only that, but 3 spaces instead of 4 then a tab for the fourth character. I slap that dev so fast the dev will try to rewrite git history.

    • Ever work with code that uses 4 spaces for column one, 1 tab for column two, 1 tab and 4 spaces for column three, etc.?

      *shudder*

    • Re:Both? (Score:5, Insightful)

      by BronsCon ( 927697 ) <social@bronstrup.com> on Thursday June 15, 2017 @10:38AM (#54625895) Journal
      I can actually see the argument for a 4-space indent consisting of 3 spaces and a tab. The developer thinks they're throwing a bone to people who use tabs by allowing them to set their own indent width. But they're wrong to use spaces at all in that case; what about people who prefer 2- or 3-char indents?

      And that's why tabs should be the standard: people prefer different indents. Using tabs, everyone can have their way; set your tab width and all tabbed indents are automatically the width you want.

      Now, for those who insist on tabs, let me explain why spaces are better: they allow you to align parameters and operators after the indent.

      That's why my preference is to use tabs to indent, then spaces to align after the indent; best of both worlds. You're already using the tab key to indent and the spacebar to align, so there's no mental or physical overhead involved, the layout of your code is preserved and, if someone else prefers a different tab width, they can have it without breaking the alignment of arguments or operators (if you bother to make them look pretty) or altering how the code displays for you, or anyone else.

      But, that's just a preference. When I'm working on someone else's code, I follow their conventions, because it really doesn't take any time at all to change an IDE setting (especially when my IDE can store per-project settings for things like tab width) and I'm not a dick.

      Beyond that, if someone uses tabs on some lines and spaces on others within the same file... yes, slap them silly.
    • Who said it was within the same file?

      For instance YML files specify that spaces must be used. But maybe tabs are standard on the project for other files.

      But all of this is moot. In 2017, the correct answer to "tabs or spaces?" is "use fucking editorconfig and stop worrying about it".

  • by Anonymous Coward on Thursday June 15, 2017 @09:47AM (#54625469)

    Proof: neither side makes jack-shit as a coder

  • Survey says (Score:5, Insightful)

    by StikyPad ( 445176 ) on Thursday June 15, 2017 @09:47AM (#54625475) Homepage

    If the median salary was under $50k, then I'm not sure who they were surveying, but it wasn't professional developers.

    • People that have been working 10+ years at this don't take surveys.
    • At least not in this country... In some places $50K is good money...

      • At least not in this country...

        Median household income in the US is $57,616 in 2016.

        https://en.wikipedia.org/wiki/Household_income_in_the_United_States [wikipedia.org]

        • CA median is over 60k$.

          Si Valley median is over 90k$

          In 2013, certainly higher now. That's median for everyone, competent techs should be north of that number.

          • That's median for everyone [...]

            Median means that half make less and half make more. It doesn't mean everyone makes the median.

            [...] competent techs should be north of that number.

            Entry-level tech jobs in Silicon Valley starts off at minimum wage ($10 per hour/$20K per year).

            • Show me one job listing looking for techs in SI valley at $10/hour? Geek squad pays better and has no competent employees.

              • Show me one job listing looking for techs in SI valley at $10/hour?

                Dell techs who have to drive 200+ miles per week. Those positions are typically available between $10 to $15 per hour. Prior to the last minimum wage increase or two, Dell paid $7.50 per hour.

                One small company I interviewed for in 2014 tried to talk me down into accepting a position at $10 per hour. Since my name was similar to another employee, the recruiter accidentally sent me the salary spreadsheet. All the techs were making $10 per hour.

                Geek squad pays better and has no competent employees.

                They can't be making that much if they're also on the government p

          • by Dog-Cow ( 21281 )

            Most developers live in neither place, you stupid ass-wipe.

    • Re:Survey says (Score:4, Informative)

      by drnb ( 2434720 ) on Thursday June 15, 2017 @10:08AM (#54625665)

      If the median salary was under $50k, then I'm not sure who they were surveying, but it wasn't professional developers.

      Those are global averages. Keep reading and you'll see the region specific charts and numbers. I think the averages for the US were around $100K and $80K.

  • by DontBeAMoran ( 4843879 ) on Thursday June 15, 2017 @09:47AM (#54625477)

    Those idiots take four times longer or more to indent their code compared to those of us who use tabs and get home earlier thus working less hours.

  • by JoeyRox ( 2711699 ) on Thursday June 15, 2017 @09:50AM (#54625499)
    Using spaces increased my earnings by 4x over tabs.
  • I press tab but the editor inserts whatever the project requires. Did the question account for this?

  • Some developers have more space to hold money, and TAB, when you can even find it is expensive.
  • by RobinH ( 124750 ) on Thursday June 15, 2017 @09:53AM (#54625543) Homepage
    I'd think that space vs. tab use is highly dependent on which programming language you're using, and I'd also think that language is correlated with earnings, so I highly doubt this conclusion (if they're trying to conclude anything). Correlation is not causation.
  • All of my editors do it for me.

    I used to be religious about using a 2 space indent, but I no longer program in Python, so, now, who gives a flip?

    Now I just want my code to look good. In Visual Studio, I do Ctrl-A, Ctrl-K, Ctrl-F, and I don't even know if it does tabs or spaces, and I don't care.

    Also, I agree that those surveyed are incredibly underpaid.
  • Anybody dare try a study about in code comments and Salary levels?

    My guess is you will see the same difference between Emacs and VI users...

  • I use tabs and I understand some people prefer spaces but what kind of hybrid-hell-beast uses both??
    • by Kvan ( 30429 )
      If I'm working on an existing codebase I use whatever that uses, and if I'm writing something from scratch I use whatever's the default for the editor I'm using.
    • I work on several projects with hundreds of different contributors. I just use whatever is there (sometimes within the same file!). So count me as "both" - though I prefer 2 spaces in general. I have to admit using a lot of 4 spaces in Python since that's what the editors seem to default to and it looks nice.

  • by prefec2 ( 875483 ) on Thursday June 15, 2017 @10:01AM (#54625597)

    Modern IDEs format code automatically and use spaces or tabs based on your settings. In addition, the auto formatter automatically adds whitespace when you go into the next line. It is most likely not a real dependency between whitespace and salaries, but it has more to do with which environment they use.

  • by TimothyHollins ( 4720957 ) on Thursday June 15, 2017 @10:03AM (#54625623)

    Let's say that using spaces was taught in the 70s, while tabs was taught in the 80s.

    Now let's say we ask people for their style and their income. The older programmers that by now make more money will say they use spaces, while the younger programmers will say tabs. This would account for the differences.

    In short, this survey isn't providing enough data to control for any factor, and the likelihood that tabs and spaces actually impact the earnings of any programmer is 0.

    Also, any programmer that uses spaces is going to Hell (which runs Windows ME on the user machines)

    • At these Salaries? The explanation is that only newbies answered the poll.

      The tab/space 'debate' has been going on so long that 'tabs produce smaller files' was once a valid argument.

  • How much money do developers who let their damn IDE do the indenting for them make? :)

    • by Tailhook ( 98486 )

      Good question. Not 100% sure I'd notice what some of the tools I use are doing wrt spaces vs. tabs. If a good formatting tool is available I will NOT manually format code. Don't care how unfortunate the result is; bang on the 'format source code' key and stop thinking about it. I don't think any one of webstorm, qtcreator, visual studio, vscode or netbeans are using tabs, but as I said; it's possible I might not notice if they did. The one thing I can affirm with metaphysical certitude is set ts=4;set

  • ... obfuscated C. What's white space?

  • There is a lot of questions out there, that these numbers don't seem to show.
    1. Which languages do they use primarily. Python for example while can handle tabs, your code needs to be consistent so using spacing is better. Normally you also set the IDE to replace tab with spaces. Other languages that don't care about white space may allow tabs and spaces to be mixed.
    2. What type of projects are they working on. Larger projects with mutable developers need to keep their coding style more or less synchroniz

  • This is probably an excellent example of where cause and correlation are not the same thing.
    Here is my suspicion, as an old programmer. The REASON why spaces are encourage over tables is for consistency of printing on a physical paper.
    Which is unimportant or irrelevant if you are not. a) doing code reviews where you are passing out dead tree copies like may have been done 10 to 15 years ago OR b) submitting source code formatted on word docs as some part of documentation to a customer as government contrac

    • >Here is my suspicion, as an old programmer. The REASON why spaces are encourage over tables is for consistency of printing on a physical paper.

      Not just. I tend to use tabs because hey, 5 spaces for one key press, and also because it aligns non-proportional fonts.

      However, MS SQL is inconsistent in its rendering of tabs. If I copy code from a script window to a SQL Agent job, everything looks like garbage... so sometimes spaces win out.

      I suspect a good part of the spaces vs. tabs debate ignores what env

  • by Leomania ( 137289 ) on Thursday June 15, 2017 @10:15AM (#54625719) Homepage
  • Sure, if you sell your soul to the devil you can make a ton of money working for the Banksters or the Military Industrial Complex.

    Am I late for the holy war?

  • If spaces are so great, why not make it more of a default in text editors and IDEs? When I get a new machine or start using a new tool, I might write a whole bunch of code using the default tabs, then realize that my Python interpreter complains about mixing tabs and spaces.
    • ... Python interpreter complains about mixing tabs and spaces....

      Really? I had heard a lot of good things about Python. But if it get confused when spaces and tabs are used interchangeable, that's pretty bad.

  • by crashumbc ( 1221174 ) on Thursday June 15, 2017 @10:22AM (#54625781)

    One space or two after a period?

    Sorry wrong crowd :P

    (and don't you heathens dare say one)

    • One space or two after a period?

      The question is another example of why you should be using tabs.

      Obviously one space is the right answer: the tool should provide the appropriate spacing without the user having to hit another key. If you need to hit space twice, then your tool is deficient.

      Similarly, tabs allow better control of indentation without the need for either the user or the tool to insert multiple characters.

    • by Tihstae ( 86842 )

      One space or two after a period?

      Sorry wrong crowd :P

      (and don't you heathens dare say one)

      It is two when using a typewriter. :-)

      • by sl3xd ( 111641 ) on Thursday June 15, 2017 @12:02PM (#54626637) Journal

        It is two when using a typewriter. :-)

        I learned to type with a typewriter, and back then most printers had a single fixed-width font, so it was still considered proper form to double-space after a period.

        It wasn't until a couple years ago I learned that it wasn't considered proper form to double-space; decades of muscle memory are hard to unlearn.

    • Re: (Score:2, Funny)

      by Anonymous Coward
      I always give my wife plenty of space when she's on her period, and for a day or so after.
  • Done. Where's my money?

  • ... and ask for the 20% salary increase?
  • Comment removed based on user account deletion
  • by Qbertino ( 265505 ) <moiraNO@SPAMmodparlor.com> on Thursday June 15, 2017 @11:07AM (#54626139)

    It's tabs. Here's why:

    1.) Tabs are characters specifically meant for indentation - that is the only reason this character exists.

    2.) They use up way less bandwidth. I once cut down an HTML document from my space fanatic buddy from 80kb to 36kb just by converting from spaces to tabs. When 50+% of your bandwidth is used up by whitespace, you're a shit coder. True thing. ... Use spaces on my product and I'll woop your ass.

    3.) With tabs everyone can decide on his own how far the indent is. That's how it's meant to be. That's the whole point of the indent character called "tab".

    That said, I've given up on trying to explain the above to space junkies - they really don't seem to get it.
    Today I usually avoid this discussion and settle for whatever the official standard is for a given programming language and use buildtools that clean up the code form excess whitespace before deployment on the web. For JavaScript that's space-indent with two spaces - really shitty, but I guess they're trying to suck it up to the C-snob crowd, so who am I to think I could stop them. The advantage in going with whatever is the standard for a given PL is that you can use the standard linters and commit hooks as they come and easyly set up your CI and build environment in such a way that it enforces uniformity. If that means only commiting two-space indents, I'll bite the bullet. Especially if I'm the lead and/or responsible for the dev-pipeline.

    • 2.) They use up way less bandwidth. I once cut down an HTML document from my space fanatic buddy from 80kb to 36kb just by converting from spaces to tabs. When 50+% of your bandwidth is used up by whitespace, you're a shit coder.

      The '90's just called and they want their webservers back. [wikipedia.org]

      With a data point of one, it appears that people who use tabs might not understand the technology they're using. This may have explanatory power.

"It might help if we ran the MBA's out of Washington." -- Admiral Grace Hopper

Working...