Dirk Riehle's Industry and Research Publications

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.”

Tagged as (if any)

Subscribe!

Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  1. Lars Brinkmann Avatar
    Lars Brinkmann

    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.

  2. Don Hesh Avatar

    It should be Tab’s. All old fashion traditional programmers are used to tabs. spaces can be very confusing.

  3. Anwar Khali Avatar

    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

Navigation

Share the content

Share on LinkedIn

Share by email

Share on X (Twitter)

Share on WhatsApp

Featured startups

QDAcity makes collaborative qualitative data analysis fun and easy.

Featured projects

Open data, easy and social
Engineering intelligence unleashed
Open source in products, easy and safe