|
|
|
|
|
by jahewson
3800 days ago
|
|
Ah, tabs are bad, because if you let people choose their own tab widths then it becomes impossible to align anything anymore. It makes it impossible to align anything which is != a tab width. Tabs aren't "designed" for indenting text: they're a hangover from typewriters, where they were literally metal tabs used for creating tables. Tabs don't carry semantics - that's the job of the language's syntax. Tabs as a concept should be confined to history IMHO, especially their implementation in modern word processors, where they just give you ad-hoc semantic-less tables. The tab key on the otherhand is great for indenting - in most sensible editors it will insert a configurable number of spaces. Perfect. |
|
> tabs are bad, because if you let people choose their own tab widths then it becomes impossible to align anything anymore.
In what world is that true. If you indent your code with tabs, and I indent your code with tabs and I show my tabs as 4 chars wide and you show yours and 8 EVERYTHING IS STILL ALIGNED. It's just greater or lesser levels of indentation. You only have problems when you MIX tabs and spaces. Be consistent in your use and you won't have problems.
> It makes it impossible to align anything which is != a tab width.
Yes. So? Don't mix tabs and spaces.
> Tabs aren't "designed" for indenting text: they're a hangover from typewriters, where they were literally metal tabs used for creating tables.
What is a table? It's a tool FOR ALIGNING MULTIPLE COLUMNS OF TEXT... so yes, they ARE designed for indenting text.
For a more fully thought out argument on why it's a dick move to use spaces as pretend tabs: http://weblog.masukomi.org/2010/07/26/why-you-should-never-i...