login
Header Space

 
 

Re: On Tabs and Spaces

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jeff King <peff@...>
Cc: <david@...>, Luke Lu <git@...>, Christer Weinigel <christer@...>, Tom Tobin <korpios@...>, <git@...>
Date: Wednesday, October 17, 2007 - 11:32 pm

On Wed, 17 Oct 2007, Jeff King wrote:

If you really are all one-or-the-other, then everything is obviously fine, 
and spaces have somewhat stronger guarantees (I say "somewhat", because 
the line-up-guarantee of all-spaces is only guaranteed with fixed-width 
fonts, and hard-tab indents often look nicer in printouts, and are 
generally much more flexible in just how wide you make the indent *look*, 
ie hard-tabs at least *allow* people to see the indents in different 
ways, even if that will potentially mess up any alignment).

But some mixing is inevitable, and at least in UNIX, the tendency is for 
tabs, not spaces, by default, so tabs have a much higher chance of 
*staying* mostly tabs, while anybody who uses spaces pretty much *will* 
get tabs inserted by just about any programming editor that isn't set up 
for python.

So you always get _some_ amount of mixing, exactly because most editors 
won't show you the difference, and what people aren't aware of, they don't 
think about. There's no getting away from that, unless you actually 
enforce it with hooks (and in a distributed environment, even that isn't 
really going to fly, is it?).

And if you *do* decide to enforce it with hooks, you now have issues like 
the fact that some files mustn't do it (autoconvert tabs to spaces in a 
Makefile, and it just stops working!), and others have somewhat subtle 
issues forcing your converter to be somewhat knowledgeable (trivial 
example: strings that are spread across multiple lines in C..)

In general, if you do enforce it (which I personally think is not likely a 
good idea, but hey, it's up to the project), I'd *still* suggest going the 
way of enforcing hard-tabs, not spaces. As mentioned, space does matter, 
but hardtabs really are "friendlier", and if you're a vi user, you can do 
a :set tabstop=4 and if that's what you're used to, it will all look 
better to you.

In contrast, all-spaces just sucks. It really has no redeeming values.

		Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: On Tabs and Spaces, Jari Aalto, (Tue Oct 16, 1:06 pm)
Re: On Tabs and Spaces, Linus Torvalds, (Tue Oct 16, 3:20 pm)
Re: On Tabs and Spaces, Dmitry Potapov, (Thu Oct 18, 12:36 am)
Re: On Tabs and Spaces, Sam Ravnborg, (Tue Oct 16, 4:56 pm)
Re: On Tabs and Spaces, Mike Hommey, (Tue Oct 16, 3:36 pm)
Re: On Tabs and Spaces, Linus Torvalds, (Tue Oct 16, 3:47 pm)
Re: On Tabs and Spaces, Matthieu Moy, (Tue Oct 16, 4:32 pm)
Re: On Tabs and Spaces, Linus Torvalds, (Tue Oct 16, 3:51 pm)
Re: On Tabs and Spaces, Tom Tobin, (Tue Oct 16, 4:18 pm)
Re: On Tabs and Spaces, Linus Torvalds, (Tue Oct 16, 7:05 pm)
Re: On Tabs and Spaces, Christer Weinigel, (Tue Oct 16, 7:51 pm)
Re: On Tabs and Spaces, Linus Torvalds, (Tue Oct 16, 8:45 pm)
Re: On Tabs and Spaces, Michael Witten, (Tue Oct 16, 11:08 pm)
Re: On Tabs and Spaces, Linus Torvalds, (Tue Oct 16, 11:29 pm)
Re: On Tabs and Spaces, Luke Lu, (Wed Oct 17, 3:17 am)
Re: On Tabs and Spaces, Michael Witten, (Wed Oct 17, 5:09 am)
Re: On Tabs and Spaces, Nikolai Weibull, (Wed Oct 17, 6:21 am)
Re: On Tabs and Spaces, Michael Witten, (Wed Oct 17, 7:23 am)
Re: On Tabs and Spaces, Luke Lu, (Wed Oct 17, 6:03 am)
Re: On Tabs and Spaces, Linus Torvalds, (Wed Oct 17, 11:53 am)
Re: On Tabs and Spaces, Johannes Schindelin, (Wed Oct 17, 2:05 pm)
Re: On Tabs and Spaces, Jeff King, (Wed Oct 17, 8:32 pm)
Re: On Tabs and Spaces, Linus Torvalds, (Wed Oct 17, 8:59 pm)
Re: On Tabs and Spaces, Jeff King, (Wed Oct 17, 10:45 pm)
Re: On Tabs and Spaces, , (Wed Oct 17, 11:03 pm)
Re: On Tabs and Spaces, Jeff King, (Wed Oct 17, 11:00 pm)
Re: On Tabs and Spaces, Linus Torvalds, (Wed Oct 17, 11:32 pm)
Re: On Tabs and Spaces, Linus Torvalds, (Thu Oct 18, 12:17 am)
Re: On Tabs and Spaces, Nicolas Pitre, (Thu Oct 18, 12:52 am)
Re: On Tabs and Spaces, Jeff King, (Thu Oct 18, 12:54 am)
Re: On Tabs and Spaces, Jeff King, (Thu Oct 18, 12:55 am)
Re: On Tabs and Spaces, Linus Torvalds, (Wed Oct 17, 11:13 pm)
Re: On Tabs and Spaces, Jeff King, (Wed Oct 17, 11:23 pm)
Re: [PATCH] git-gc: improve wording of --auto notification, Shawn O. Pearce, (Thu Oct 18, 9:24 pm)
Re: On Tabs and Spaces, Tom Tobin, (Wed Oct 17, 2:25 pm)
Re: On Tabs and Spaces, Linus Torvalds, (Wed Oct 17, 2:54 pm)
Re: On Tabs and Spaces, Jan Wielemaker, (Wed Oct 17, 3:47 pm)
Re: On Tabs and Spaces, Tom Tobin, (Wed Oct 17, 3:33 pm)
Re: On Tabs and Spaces, Johannes Schindelin, (Wed Oct 17, 5:08 pm)
Re: On Tabs and Spaces, Nicolas Pitre, (Wed Oct 17, 3:48 pm)
Re: On Tabs and Spaces, Linus Torvalds, (Wed Oct 17, 3:53 pm)
Re: On Tabs and Spaces, Christer Weinigel, (Wed Oct 17, 5:21 pm)
Re: On Tabs and Spaces, Johannes Schindelin, (Wed Oct 17, 6:11 pm)
Re: On Tabs and Spaces, Christer Weinigel, (Wed Oct 17, 7:17 pm)
Re: On Tabs and Spaces, Johannes Schindelin, (Wed Oct 17, 7:44 pm)
Re: On Tabs and Spaces, Christer Weinigel, (Wed Oct 17, 8:31 pm)
Re: On Tabs and Spaces, Andreas Ericsson, (Thu Oct 18, 2:02 am)
Re: On Tabs and Spaces, Linus Torvalds, (Wed Oct 17, 7:53 pm)
Re: On Tabs and Spaces, Linus Torvalds, (Wed Oct 17, 6:03 pm)
Re: On Tabs and Spaces, David Kastrup, (Thu Oct 18, 2:25 am)
Re: On Tabs and Spaces, Linus Torvalds, (Wed Oct 17, 3:44 pm)
Re: On Tabs and Spaces, David Kastrup, (Wed Oct 17, 4:31 pm)
Re: On Tabs and Spaces, Josh England, (Wed Oct 17, 3:52 pm)
speck-geostationary