Who actually uses tabs instead of spaces? I'm genuinely curious--one of the first things pretty much any project I've ever been involved in has been the setting of tabs characters to become spaces, simply because all text editors are retarded in this regard. This is quite strange.
Tabs and spaces both have their respective advantages and disadvantages.
Advantages of tabs:
- you can choose your indentation width in most editors, so coders don't have to agree on indentation width (this is really the only major advantage)
- most very-basic editors that can't be configured, such as Notepad or the command-line directly, will default to having the tab key insert a tab character, which is easier to press than space N times (it's rare to edit code in such cases, though)
- slightly smaller file-size, although this is pretty irrelevant in modern times
Advantages of spaces:
- certain editors are dumb and will mangle tabs in various ways (for instance, converting "3 tabs for indentation, 9 spaces for alignment" into 5 tabs and 1 space)
- most file viewers that won't let you configure tab width (for instance, browsers, which is relevant to viewing code on GitHub) will have tab width set to 8 spaces, which is very awkward
- avoids the problem of some people accidentally using tab for alignment and then having alignment be messed up when coders have different tab width settings
- certain text fields, such as browser text boxes, will have the tab key focus the next input field instead of inserting a tab character, which makes inserting tab characters difficult sometimes (it's rare to edit code in such cases, though)