With storage space being plentiful and cheap these days, any minor benefit that was once gained by using tabs instead of spaces is gone. The benefit was so small that even inf the Olden Days (and especially on record-oriented filesystems) it probably didn’t matter, and the space argument was made after the fact as a post hoc justification.
The best justification for using “real” tabs versus spaces is this: the file looks right to whoever is viewing it, assuming they have their editor set up to display tabs the way they want.
The best justification for using spaces is that the file looks the same no matter who’s looking at it, or the configuration of the editor.
The second best justification for spaces is that it’s very easy for source code to get visibly mis-indented with real tabs (things that used to line up now don’t because the width of the preceding text is different enough that the tab multiple jumps by one).
The compromise is Elastic Tabstops, but it requires editor support.
Not necessarily true, for example if somebody is using a variable width font.
Two more reasons for using tabs:
Next up on Eternal Holy Wars: fixed-width vs variable-width fonts for coding.
The author gives reasons to avoid mixing tabs and spaces for the same purpose, but I feel like that’s taken for granted in most arguments these days. Using tabs in a tabstop-agnostic way avoids the potential pitfalls he mentions, with the added benefit that people can choose how many columns to indent for each indentation level.
Holy war? For the love of God, the linked page is seventeen years old.
There is already a tag for ‘historical’. I’m starting to wonder if we don’t also need one for ‘archaeological’ at the rate these old bones keep getting dug up…
It’s still a holy war. Those don’t ever end, you know. This could have been written last week, except then it would mention gofmt!
related link: https://medium.com/@hoffa/400-000-github-repositories-1-billion-files-14-terabytes-of-code-spaces-or-tabs-7cfe0b5dd7fd
(I love how Go is 100% tabs)