Generally aligning stuff isn’t nice. But if you do, it’s tabs up to whatever level of indentation you’re at then spaces the rest of the way. So you wouldn’t have to assume a tab size. And the tabs and spaces have different semantic meaning (indent vs alignment) so mixing them makes sense. It’s even built into Jetbrains IDEs, where it’s called “Smart Tabs”.
Although really just adding a level of indent is better than aligning.
This is a legit observation. However, I would argue that spaces needs a set indentation width anyway, so if tabs had a set indentation width that coders are expected to maintain when aligning code, it wouldn’t make a difference. Enforcing that in practice may be different, but in theory it works.
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmerhumor@lemmy.ml
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
Posts must be relevant to programming, programmers, or computer science.
No NSFW content.
Jokes must be in good taste. No hate speech, bigotry, etc.
Tabs work fine as long as you don’t align stuff. If you do, you have to assume a tab size and mix tabs and spaces.
Generally aligning stuff isn’t nice. But if you do, it’s tabs up to whatever level of indentation you’re at then spaces the rest of the way. So you wouldn’t have to assume a tab size. And the tabs and spaces have different semantic meaning (indent vs alignment) so mixing them makes sense. It’s even built into Jetbrains IDEs, where it’s called “Smart Tabs”.
Although really just adding a level of indent is better than aligning.
This is a legit observation. However, I would argue that spaces needs a set indentation width anyway, so if tabs had a set indentation width that coders are expected to maintain when aligning code, it wouldn’t make a difference. Enforcing that in practice may be different, but in theory it works.