lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <47C1980C.4050800@panasas.com>
Date:	Sun, 24 Feb 2008 08:15:08 -0800
From:	Benny Halevy <bhalevy@...asas.com>
To:	Richard Knutsson <ricknu-0@...dent.ltu.se>
CC:	Krzysztof Halasa <khc@...waw.pl>,
	Linux kernel mailing list <linux-kernel@...r.kernel.org>
Subject: Re: Tabs, spaces, indent and 80 character lines

On Feb. 24, 2008, 7:40 -0800, Richard Knutsson <ricknu-0@...dent.ltu.se> wrote:
> Krzysztof Halasa wrote:
>> Richard Knutsson <ricknu-0@...dent.ltu.se> writes:
>>
>>   
>>> Why hinder a developer who prefer
>>> 2, 4, 6 or any other != 8 width?
>>>     
>> I guess we could use tabs only at the line start, for indentation
>> only. Rather hard to implement, most text editors can't do that yet.
>>   
> You mean for split lines? Hopefully there won't be that many, so there 
> is just to delete the tabs it added and replace it with spaces.

IMO, tabs SHOULD be used for syntactic indentation and spaces for
decoration purpose only.  I.e. a line should start with a number of tabs
equal to its nesting level and after that only spaces should be used.
for example, the following code

for (i = 0; i < n; i++) printk("a very long format string", some, parameters);

should be formatted like this:

<tabs...>for (i = 0; i < n; i++)
<tabs...><tab>printk("a very long format string",
<tabs...><tab>       some, parameters);

this will show exactly right regardless of your editor's tab expansion setting
as long as you use fixed-width fonts - where the screen width of the space character
is equal to all other characters.  Once you start using tabs instead of spaces
to push text right so it appears exactly below some other text on the line above
you make a dependency on *your* editor's tab expansion policy and that's not very
considerate for folks who prefer a different one.


>>   
>>> By only using tabs as indents, and
>>> changing the CodeStyle to be something like "maximum 80
>>> characters-wide lines, with a tab-setting of 8 spaces",
>>>     
>> This changes nothing.
>>   
> Exactly! But then we can remove the "we use 8 wide tabs in the kernel" 
> in CodeStyle.
>>   
>>> that is
>>> possible + easier to write code-checkers [2].
>>>     
>> I doubt it.
>>   
> Easier to write code-checkers? OK, maybe not. Just that I got hit by 
> this problem at a time when I wrote a simple checker (don't remember its 
> purpose).
>>   
>>> Or are we really that concerned about the disk-space? ;)
>>>     
>> Unpacked sources will be much bigger with not tabs, sure.
>>   
> Without no tabs at all, you mean? Don't want to think about that 
> scenario, but with this suggestion, I would estimate maybe 0,5 - 1% bigger.
> 
> Thanks for your input
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ