Slashdot Mirror


400,000 GitHub Repositories, 1 Billion Files, 14TB of Code: Spaces or Tabs? (medium.com)

Here's a debate that refuses to die: given a choice, would you rather use spaces or tabs? An episode of Silicon Valley last season had a bit on this. Now we have more data to analyze people's behavior. A Google developer has looked into 400,000 GitHub repositories -- 1 billion files, 14 terabytes to find that programmers with interest in specific languages do seem to prefer either tabs or spaces. Spoiler alert: space wins, like all the time.

6 of 391 comments (clear)

  1. Tabspaces? by PCM2 · · Score: 5, Insightful

    Yeah, OK, I get it. Spaces make it easier to cut and paste your code into whatever and have it look the same. But does anybody seriously type all those spaces? You don't just set the Tab key to expand to spaces?

    --
    Breakfast served all day!
    1. Re: Tabspaces? by gfxguy · · Score: 5, Interesting

      Python is my go-to scripting language when possible, but it's the one thing about it that bothers me - the anal retentive way it forces you to follow Guido's formatting standards. Yes, there is some choice, but when you figure out that tabs make more sense you become an outcast in the python community.

      --
      Stupid sexy Flanders.
  2. Spaces are for people who don't understand tabs by Viol8 · · Score: 5, Insightful

    The whole point of a tabstop is you can change its width so a file can be indented to the preference of the person reading/editing it (set ts=[width] in vi). With spaces you're stuck with the (often poor) indentation the author chose who is essentially saying "Fuck you, you're going to read the code indented the way I want, not the way you want"

  3. Theory vs. Practice by rockmuelle · · Score: 5, Insightful

    In theory, tabs are the right solution. In practice, spaces are the right solution.

    -Chris

  4. Re:Both. by WallyL · · Score: 5, Insightful

    Ew. That's an unusual combination of tabs and spaces.
     
    ...and also because of Emacs.

  5. one thing the tabs and spaces folks agree on by dlang_rocks · · Score: 5, Funny