[Swan-dev] [Swan-commit] Changes to ref refs/heads/master

Lennart Sorensen lsorense at csclub.uwaterloo.ca
Sat Mar 29 21:04:11 EET 2014


On Sat, Mar 29, 2014 at 02:38:10PM -0400, D. Hugh Redelmeier wrote:
> "Descendants are always substantially shorter than the parent and
> are placed substantially to the right."
> 
> That's all I see about breaking lines in
> <https://www.kernel.org/doc/Documentation/CodingStyle>
> 
> I don't see anything about "match [open bracket of function call]
> as near as possible".
> 
> I would like to stretch it.  Only indent one additional tabstop.
> That's enough.  Approximations are neither fish nor fowl.
> 
> My suggested exception: if the thing after the broken bit will be
> indented, you need to indent the broken bit differently to make it
> visually distinct.  So, here's a way that can be done.
> 
> 	if (a long test that goes on and on ||
> 			a wide test that goes on and on) {
> 		do_the_thing();
> 	}

Oh yes, for condition continuation it uses 2 or more tabs to make sure
it doesn't get confused with the block contents.

> (My preferred style, which we've rejected, is clearer still:
> 	if (a long test that goes on and on
> 	|| a wide test that goes on and on) {
> 		do_the_thing();
> 	}
> Even more stark if you remove the braces.
> )

That is NOT clearer.

-- 
Len Sorensen


More information about the Swan-dev mailing list