lkml.org 
[lkml]   [2002]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Indention - why spaces?
This problem is as old as the typewriter itself.  The trouble is that a 
Tab character doesn't have a fixed size - some set it to 3 characters
wide, some to 4 some to 8, or whatever.

The 'indent' program was written a couple of decades ago, to pretty
print C code. It has a 'GNU' standard, but I'm not aware of a 'Linux'
standard. Anyhoo, the only way to prevent indentation wars is to use
spaces, not tabs and to set 'diff' to ignore white space when comparing
files...

Arnaldo Carvalho de Melo wrote:
> Em Mon, Dec 30, 2002 at 07:53:22PM +0100, Emiliano Gabrielli escreveu:
>
>><quote who="Dave Jones">
>>
>>>On Mon, Dec 30, 2002 at 12:49:33PM +0000, John Bradford wrote:
>>> > > Well, I disagree: http://www.wiggy.net/rants/tabsvsspaces.xhtml
>>> > In my opinion, indentation in any form is irritating.
>>>
>>>The devfs source code is --> that way.
>>>
>>
>>IMHO and in my personal projects I use the following indenting rules:
>>
>>1) use TABs for _indentation_
>>2) use SPACEs for aligning
>>
>>here is an exaple:
>>
>><tab><tab>if (cond) {
>><tab><tab><tab>dosometing;
>><tab><tab><tab>printf("This is foo: '%s', and this bar: '%d'",
>><tab><tab><tab> foo, bar);
>>
>>where tabs are explicitated, while spaces not.
>>
>>
>>I think this way combines both tab and spaces advantages, allowing each coder
>>to have its own indentation width, but NEVER destroing the aspect of the code.
>>
>>This is only my opinion :-P
>
>
> I second that.
>
> - Arnaldo
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>

--

------------------------------------------------------------------------
Herman Oosthuysen
B.Eng.(E), Member of IEEE
Wireless Networks Inc.
http://www.WirelessNetworksInc.com
E-mail: Herman@WirelessNetworksInc.com
Phone: 1.403.569-5687, Fax: 1.403.235-3965
------------------------------------------------------------------------


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:32    [W:0.074 / U:0.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site