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]
Date:	Tue, 08 May 2007 19:01:20 -0400
From:	Jeff Garzik <jeff@...zik.org>
To:	Stephen.Clark@...lark.us
CC:	Lennart Sorensen <lsorense@...lub.uwaterloo.ca>,
	Randy Dunlap <randy.dunlap@...cle.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: CodingStyle: start flamewar about use of braces

Stephen Clark wrote:
> Lennart Sorensen wrote:
>> On Tue, May 08, 2007 at 05:19:45PM -0400, Jeff Garzik wrote:
>>> If anyone tries to add braces to my code's 'else' statements where 
>>> they are not required, that patch will get NAK'd in a heartbeat.

>> Oh isn't coding style fun.  I personally hate code that doesn't ALWAYS
>> have the braces everywhere since it makes adding a print statement
>> or other debuging to the condition such a pain since you then have to
>> add braces to the condition to avoid breaking the code just to insert
>> a print statement.  It is one of the few things I disagree with in the
>> linux kernel coding style.

> I agree - it is merely defensive programming to always have the braces, 
> it prevents someone
> from sticking in a diag and forgetting to add braces so things go haywire.


If you compulsively add braces where not needed, the number of lines in 
the source file explodes.  Net result is code that is more difficult to 
read, because far fewer lines of code fit on a single page/screen.

But hey, it's personal preference.  I'm not going to enforce the 
make-code-more-readable rule on others' code... :)

	Jeff


-
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