DEV Community

Pandiyan Murugan
Pandiyan Murugan

Posted on

Tabs vs Spaces?

What're the real technical key aspects that need to be considered before deciding or coming to a conclusion of battle of Tabs vs Spaces?

Latest comments (34)

Collapse
 
pandiyancool profile image
Pandiyan Murugan

The end!

Collapse
 
pandiyancool profile image
Pandiyan Murugan

Cool

 
pandiyancool profile image
Pandiyan Murugan

I prefer tabs

And 2*2 config

Means size of tab

Collapse
 
alvaromontoro profile image
Alvaro Montoro

3 reactions and 21 comments... You knew what you were getting into 😋

Collapse
 
pandiyancool profile image
Pandiyan Murugan

Yes....

 
abdisalan_js profile image
Abdisalan

Sorry for the confusion, when I say 4 spaces vs 2 spaces, I mean the tab character \t displays as that number of spaces.

There is no conversion, the linter keeps everything as tabs so there's to worry of mixing tabs and spaces and everyone can display their indentation how they like.

I think this entire debate isn't really worth discussing given the current state of linting/developer tooling.

Collapse
 
abdisalan_js profile image
Abdisalan

IDEs showing tabs how I like is a good thing! If the code base has 2 space indentation, why should I be forced to view my code that way if my IDE can just display it with 4 spaces and commit to GitHub with 2 spaces?

Collapse
 
sulutas81 profile image
Şaban Ulutaş

a never ending discussion, hahah :)

Collapse
 
pandiyancool profile image
Pandiyan Murugan

EOF

Collapse
 
astrit profile image
Astrit

Tabs.

Collapse
 
pandiyancool profile image
Pandiyan Murugan

±1

Collapse
 
leighshammer profile image
Leigh Barnes

It really dosnt matter, as long as a code base is maintained and standardized.
There is literally nothing worse than seeing a Tabs Vs Spaces comment on a PR, I would hate to know how much time effort and frustration and company times has been lost to this argument.

Collapse
 
pandiyancool profile image
Pandiyan Murugan • Edited
           Hmmm....

Added some spaces here

Collapse
 
jonashdown profile image
Jon Ashdown

The issue arose from a number of factors, but primarily boils down to the visual differences which occur in badly configured IDEs

I personally use the tab key to indent, but configure my IDE based on the linting rules of the project I am working on.

docs.google.com/presentation/d/1Kk...

Collapse
 
pandiyancool profile image
Pandiyan Murugan

Thank you