Re: tabs in source code

[prev] [thread] [next] [lurker] [Date index for 2006/06/19]

From: Smylers
Subject: Re: tabs in source code
Date: 23:18 on 19 Jun 2006
David Champion writes:

> I also hate when people use spaces instead of tabs.  ... They work
> fine together if you only tab where you want tabs ...
> 
> int
> main(int argc, char *argv[])
> {
> 	printf("like this: %s\n",
> 	       "spaces");
> 	exit(0);
> }
> 
> That works wonderfully with any tab size.

No it doesn't.  

For a start, now that I've quoted your code (with a less-than sign and a
space) only the code that was hard left against the edge has moved; the
other lines now have a tab which is giving an effective indent of 2
characters less than before, (and less than other indentation levels, if
there were any).  You get a similar effect when diff-ing code puts
symbols in the first column to indicate removals and additions.

Also, I'm not that bothered how big indentation levels are, but I do
care that source code lines don't exceed 80 characters: I want them to
fit in a standard size terminal, to be readable in an e-mail message, to
be able to run diff on code and not find the lines are so long that it
takes a dedicated 'Where's Wally'[*0] watcher to spot where the actual
differences are.

And if tabs are variable, you can't know the length of a line, therefore
you can't break them before 80 characters.

Smylers

  [*0] 'Where's Waldo', I believe, in some jurisdictions.
There's stuff above here

Generated at 20:01 on 27 Jun 2006 by mariachi 0.52