Tabs vs Spaces

Michael Torrie torriem at chem.byu.edu
Sat Nov 4 20:06:24 MST 2006


On Sat, 2006-11-04 at 19:45 -0700, Shane Hathaway wrote:
> I hope we can nip this in the bud.  This question is undecidable in 
> general.  Projects like the Linux kernel demand 100% tabs, while most 
> Python projects demand 100% spaces.  So the correct answer depends on 
> the project.  Either standard is OK, but combining spaces and tabs 
> always seems to lead to broken formatting.  Even Levi's critique to your 
> code came out with bad formatting on my email client.

There is one case where mixing tabs and spaces might be useful.
Consider:

<tab>	<tab>	printf("%s: %d, %d",
<tab>	<tab>	<spc>  some_string_variable,
<tab>	<tab>	<spc>  some_integer,
<tab>	<tab>	<spc>  some_integer2);

Tabs can make sure that no matter what the user wishes to set his tab
stops at, the indentation is always consistent.  Spaces can then allow
for sub-positioning, so that the argument list always lines up no matter
what the tab stop settings.  If you always replace spaces with tabs,
this can get messy.  Which is probably why many folks prefer to convert
all tabs to spaces.

Michael


> 
> Hopefully you're not going to ask how wide a tab should be.  The 
> decidability of that question is, ahem, undecidable. :-)
> 
> Shane
> 
> 
> /*
> PLUG: http://plug.org, #utah on irc.freenode.net
> Unsubscribe: http://plug.org/mailman/options/plug
> Don't fear the penguin.
> */
> 




More information about the PLUG mailing list