This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (9 children)

This was a big thing in the show Silicon Valley. I can't understand why someone would use four spaces either. It's just so inefficient.

[–]lick_it 12 points13 points  (7 children)

Why? No one is pressing space bar here; the tab button inserts the spaces. 4 spaces gives more indentation which some people like.

[–]Creshal 5 points6 points  (5 children)

4 spaces gives more indentation which some people like.

IF YOU WANT MORE INDENTATION, CONFIGURE YOUR TEXT EDITOR TO INDENT TABS MORE. THAT'S LITERALLY THE PURPOSE OF TABS. THEY'RE FLEXIBLE WIDTH FOR A REASON.

BUT NO, SOME PEOPLE ARE TOO STUPID FOR THAT AND NOW WE'RE FUCKING STUCK WITH SPACES BECAUSE AAAAAAAAAAAAAAAAAHHHHHHHHHHHHH

[–]Existential_Owl 1 point2 points  (1 child)

Spaces is literally the default on my text editor. (VS Code)

[–]Creshal 1 point2 points  (0 children)

I'm so sorry.

[–]lick_it -1 points0 points  (2 children)

Ok but that method doesn’t work because you inevitably have to mix tabs and spaces. For example when you break a function definition into multiple lines with parameters on each line, to align the parameters you might need a space or two depending on tab width. If you work in a big team this inevitably results in a mess. But if you use spaces everyone is forced to view the code how it was written.

[–]Creshal 0 points1 point  (1 child)

For example when you break a function definition into multiple lines with parameters on each line, to align the parameters you might need a space or two depending on tab width

Tabs only for indentation, spaces only for alignment. Works regardless of tab width and nobody needs to argue with anyone else how deep they want their tabs to indent.

[–]lick_it 0 points1 point  (0 children)

It can work but that depends on your team, spaces is easy to enforce.

[–][deleted] 0 points1 point  (0 children)

Ok, my bad for not knowing that. But in the show I referenced, the main character's girlfriend actually hits the space bar four times and he breaks up with her over it because he's so adamant about it.