Email or username:

Password:

Forgot your password?
Top-level
Meow :verified:

@catsalad Is there even a standard that specifies how many spaces a tab should be?

13 comments
Rupert

@housepanther @catsalad The whole point is that the reader gets to choose.
Using spaces tells the reader that you hate them and hope they get leprosy.

Rupert

@housepanther @catsalad Yes, I was on the losing side of that war. Still not convinced it was the wrong one.

danrot

@rupert @housepanther @catsalad Because it wasn't. I was on team "don't care" for quite a long time, but since I stumbled upon this reddit post it is clear to me that tabs are a lot better: reddit.com/r/javascript/commen

weebull

@danrot @rupert @housepanther @catsalad If people could actually, consistently limit tabs to block indentation, and never use them for alignment, then I might be convinced, but I've never seen this happen across a team.

The result is, especially in code bases written with a narrow tab stop active, that alignment (i. e. Indentation done that needs to be the same width as some text) will invariably be done with a mixture of tabs and spaces. Change the tab stop and everything breaks in a way that helps nobody, especially visually impaired people.

This is probably a tooling problem as much as anything, but tabs are too easy to get wrong.

@danrot @rupert @housepanther @catsalad If people could actually, consistently limit tabs to block indentation, and never use them for alignment, then I might be convinced, but I've never seen this happen across a team.

The result is, especially in code bases written with a narrow tab stop active, that alignment (i. e. Indentation done that needs to be the same width as some text) will invariably be done with a mixture of tabs and spaces. Change the tab stop and everything breaks in a way that helps...

Meow :verified:

@weebull @danrot @rupert @catsalad That's why they need to be standardized across the board at a nice even number like 4 spaces. Until that happens, spaces are definitely the way to go over tabs.

danrot

@weebull @rupert @housepanther @catsalad Aligning stuff is a horrible idea IMO anyway, since it forces you to change multiple lines as soon as one longer name term is introduced. Get rid of that and you'll have a better code base no matter if you are using tabs or spaces.

weebull

@danrot @rupert @housepanther @catsalad I agree for separate statements, but you don't align to parenthesis in multiline statements?

danrot

@weebull yeah, but I don't see how tabs are a problem here 🤔 Or I don't understand what you mean by that, care to share an example? All I know is that I never ran into issues with tab code bases.

Kaiyalai

@housepanther @catsalad in my experience it’s usually either three or five spaces and I can never predict which. But usually one of those.

Go Up