Hacker News new | ask | show | jobs
by TuGuQuKu 2850 days ago
It is maddening that there is even still a "discussion" happening. Tabs for indentation, spaces for alignment. Didn't even get mentioned in the article. All the pros, zero cons. Enough of this. Enough, enough.

"Use tabs for indentation, spaces for alignment: the superior approach. Code is indented and aligned properly, and indentation is flexible. Use spaces for both indentation and alignment: still fine, but not flexible enough. Use tabs for both indentation and alignment: completely unacceptable, leads to headaches."

Since this also happens every time, if you're currently writing a harebrained reply about "mixing tabs and spaces!!!!", you don't understand what's being discussed and should permanently recuse yourself from the conversation.

1 comments

The problem is that most programmers do not bother to make whitespace visible, so tabs-for-indentation-spaces-for-alignment inevitably leads to a mess of mixed tabs and spaces.

I personally use tabs-for-indentation-spaces-for-alignment in my personal code, but I think I'd lose my mind if I tried to mandate it for a public or team project without a standard code formatter like gofmt.

Even though I'd push for tabs-for-indentation-spaces-for-alignment, I agree with your sentiment.

The "both"-camp is divided in two groups: the "don't care"-group and the "strict rules"-group (the former probably being much larger).

There was a Stack Overflow developer survey in 2017 which concluded that space users make more than tab/both users. Would be interesting to see the results when accounting for above difference in the both group.