Hacker News new | ask | show | jobs
by joewood1972 3675 days ago
The best answer is to use a tool that saves in the format that the file was in originally. I think VSCode and some others do that. If the file only has 2-space indentation then TAB becomes 2-spaces. etc...

That said, assuming a greenfield the best case has to be to use tabs. This way if somebody has a preference to small indents then they can configure the TAB to render as 2-spaces - it becomes a render issue.

So, use a modern tool and it's a moot point.

P.S. not sure why Silicon Valley's Richard started talking about 8 space tabs. That would be crazy. The only time I've seen that is in a proportional font in a word processor.

1 comments

GitHub renders tabs as 8 spaces. It is crazy and looks ridiculous.
This is actually the only truly rational defense I can come up with for my preference of spaces vs tabs. (The generic argument is that the code will look the way I want it to even when rendered by a tool where I can't control the tab width, but Github is the only real example these days.)