Tabs vs. Spaces and Cause vs. Effect

Stack Overflow of the “full stackoverflow programmer” fame just published a developer survey. Among the items was a question asking developers, what they prefer for indenting their code: Tabs or spaces?

The majority of developers prefers tabs over spaces by a reasonable margin. What worries me, though, is the conclusion or the “trend” that the summary writer sees in the data: That more experienced developers prefer spaces over tabs.

The author of the summary is somewhat cautious to avoid saying this, but the casual reader might be led to believe that experience leads to choosing spaces, which is of course a jump to conclusions not warranted by the data. Maybe these are just older developers, still using vi? You may notice elsewhere in the survey that Notepad++ is the preferred editor of choice (though it is not clear to me whether IDEs were in the running for this question). We don’t know, not enough information is given.

Ultimately, it all boils down to understanding cause and effect or, more academically, correlation vs. causation. I’ll pick up this topic in my research class, Nailing your Thesis, this coming winter. The textbook of choice for the topic is Angrist and Pischke, “Mastering ‘metrics: The path from cause to effect.”

3 Replies to “Tabs vs. Spaces and Cause vs. Effect”

  1. I think, everyone using TAB’s. That’s the way we learn our basic coding 15 years a go. we we coding with MSDOS. Any real programmer will coose Tab’s

  2. If you work together with others on same software projects, the development environment is mostly heterogeneous. Some have tabs2spaces, other spaces2tabs. The defined tab width can differ from 2 to 8.
    Version management will be than difficult sometimes. Code changes occure which are only tab/space replacements. A time consuming issue.
    The code won’t look the same on different programmer pc’s.
    For me a monotype font and spaces are the base. My editor’s and ide’s handle it. I press tab and the correct amount of spaces will be inserted, to meet the next tab point.

Leave a Reply