DEV Community

Discussion on: Who Killed The Tab?

Collapse
 
nomade55 profile image
Lucas G. Terracino • Edited

I completely feel you. I've been writing code around 5 years now. Not really such a long way, but long enough to watch people ask me "Why do you use tabs?"

I truly didn't know when I started about conventions or standards. Caming from a non engineering or related background, it just felt natural to press tab and watch it indent once, with a tab.

Even if its just a matter of preference, I think preferences and standards should be guided to working more efficently, tabs are just easier to read like you pointed out.

Collapse
 
bytebodger profile image
Adam Nathaniel Davis

I try not to get too much into the empirical arguments - because they tend to become circular, based on your own preferences. But when I do allow myself to go down the rabbit hole of actually quantifying why anyone would use tabs or spaces, I can't help but point out that:

  1. According to Merriam-Webster, a "tab" is a key on a keyboard that indents text by a preset amount. In other words, the tab characters (which are created with the TAB key) do exactly what is called for when we say that you should indent your code.

  2. Everyone I know who hates tabs, still uses the TAB key... to insert spaces (indentation) in their code.

But such "logical" arguments get lost in a lot of passion and vitriol. Devs just don't seem to be able to talk rationally about it.

Collapse
 
nomade55 profile image
Lucas G. Terracino • Edited

Very fair points.

I think it's not only a matter of passion, it comes down to changing habits and codebases.

The ball is already rolling for many javascript projects. At one point, people who might accept for a moment the idea of using tab, go back to work where all the files are indentend with two spaces, and the amount of work required to change that is not worth it.