Jeff Garzik wrote:
> Tejun Heo wrote:
>> Is this agreed upon? I tend to omit almost all unnecessary (by operator
>> precedence) parenthesis, so in new EH and all other stuff, the "a && b &
>> c" sort of lines are abundant. If this is something that's agreed upon,
>> I can do a clean sweep over those.
>
>
> More parens == easier to review. So
> a && b & c
> should be
> a && (b & c)
Understood. Usually, my rule is something like doing the least
maximizes consistency (style-wise) thus increasing readability in the
end, but rules usually suck, don't they? What fits the most eyes is the
best, I guess.
> to clearly delineate the separate expressions to the human eye, and also
> make it clear to the reader that the '&' is intended, and not a typo
> that should have been '&&'.
>
> Anytime you see a long string of 'if' conditions, and the operators
> vary, add parents for readability.
>
Yeap, will do, from now on.
--
tejun
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]