08/06/2021, 7:46 pm
My bane and mental anguish is tabs, period.
Is a tab two spaces? Four? Eight? For my code, in BASIC the indent is two spaces (because I started coding on the Beeb in MODE 7). For C, the indent is three spaces or align with the above elements (makes sense with switch statements and anything spamming multiple lines).
Spaces throughout. Never tabs.
I've had code (written by others) where people have used different tab sizes at different times in the program (usually 4 or 8) and no expansion fixes that mess. Tabs belong in a word processor, not in code.
The terminal treating tabs as spaces is not great, but it probably saved an amount of code figuring out what the hell to do with them. It's not just placement, it's size, it's cursor backwards over them, it's inserting characters and coping, it's just annoying.
(I think the crappy terminal I wrote a billion years ago did the same thing for the same reason; doing tab properly was a wishlist item, not a requirement)
Is a tab two spaces? Four? Eight? For my code, in BASIC the indent is two spaces (because I started coding on the Beeb in MODE 7). For C, the indent is three spaces or align with the above elements (makes sense with switch statements and anything spamming multiple lines).
Spaces throughout. Never tabs.
I've had code (written by others) where people have used different tab sizes at different times in the program (usually 4 or 8) and no expansion fixes that mess. Tabs belong in a word processor, not in code.
The terminal treating tabs as spaces is not great, but it probably saved an amount of code figuring out what the hell to do with them. It's not just placement, it's size, it's cursor backwards over them, it's inserting characters and coping, it's just annoying.
(I think the crappy terminal I wrote a billion years ago did the same thing for the same reason; doing tab properly was a wishlist item, not a requirement)