Thread (95 messages) flat view 95 messages, 33 authors, 2016-06-15

Re: On Tabs and Spaces

From: Tom Tobin <hidden>
Date: 2016-06-15 22:43:42

On Tue, 2007-10-16 at 12:20 -0700, Linus Torvalds wrote:
The only sane solution is the one the kernel and git have always used: 
tabs are 8 spaces wide, and anybody who disagrees can go screw themselves. 
If you don't have 8-character tabs, you *will* get odd indentation.

And no, the answer is not to say "don't use tabs at all" and replace them 
by spaces. The answer is *also* not "tabs are just for initial code 
indents", because not only will most sane editors never even show the 
difference, it's simply not how people work. So such a rule about 
invisible things doesn't work.
[...]
The fact that some projects have encouraged bad coding style and *insane* 
tab values is not a git problem. We should teach people to do *better*, 
not become worse just because others have done idiotic things.
I'm reading two different ideas here, and it seems like you're
conflating the two — and, in the process, telling some pretty smart
people (smarter than me, anyhow) to go fuck themselves.

If a project uses tabs, your statement regarding 8-char-width tabs makes
sense; you need some rule by which you can assume others are viewing the
same thing you are.

But you then dismiss out of hand the option of using all spaces; Python
has been getting along perfectly well for quite some time by following
this rule, and my experience with the language leads me to believe it's
the wiser of the choices.  Questions over tab width simply *go away*;
you pick an indentation level (Python uses 4) and stick with it.

I'm not arguing that git should switch to all spaces; projects tend to
become set in their ways, and consistency can be valuable.  I'm merely
pointing out that all-spaces is a quite *sane* option, even if it's one
git doesn't choose.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help