|
|
|
|
|
by Reelin
2406 days ago
|
|
It does seem like an additional reason, but I'm convinced tabs were (are?) disliked primarily for historical and technological reasons. Historically the tab key worked with a tab stop; there's always friction when you switch paradigms. Technologically, accommodating a variable width non-printing character on an 80x25 character-mapped display for no particular reason must have seemed both gratuitous and wasteful when you consider the typical hardware of the time (monochrome terminals, CPUs on the order of 1-50 MHz, 1-5 MB RAM, < 1 MB ROM, etc). |
|
Huh? AFAIU, all the historical source code uses tabs for indentation. Both K&R and BSD style uses hard tabs, as does Linux kernel style and most older GNU project code for that matter. Various Unix programs assume tabs, for example indentation elision in shell heredoc syntax ("<<-") only works for tabs.
Soft tabs (spaces) has been a relatively new thing in the C/Unix world. You may not notice it because, working as well as they do, hard tabs magically indent according to your local preference, so hard tabs aren't noticeable.[1]
[1] What doesn't work is right-hand alignment. That's most noticeable in modern BSD code, where the style is to tab-align variable types and names into different columns. If your tab stop isn't set to 8 (the required tab stop), they don't line up. Most hard tabbers don't mix indentation and alignment, anymore.
EDIT: Here's the earliest source code for vi I could quickly find: https://github.com/n-t-roff/ex-2.2/blob/220a2cfa/ex.c It uses hard tabs. It's also still using pre-ANSI function syntax, suggesting this code wasn't cleaned up before committing to Git.