Apart from all the other excellent points on why the current coding style (see Wiki) makes sense, let me offer one last piece of advice. I wrote 50% of the kernel code, and the other 30% is written by people whom I have tutored and taught our official coding style (for some reason it now seems to have become unofficial?!).
If you choose another coding style, you'll now have to re-write 80% of the kernel code to match it.
Best regards, Alex Ionescu
On Mon, Feb 16, 2009 at 4:14 PM, James Hawkins truiken@gmail.com wrote:
On Mon, Feb 16, 2009 at 12:54 PM, Timo Kreuzer timo.kreuzer@web.de wrote:
Zachary Gorden schrieb:
I agree with the requirement for the parenthesis, simply because it
helps
separate the various conditions that are being tested for. Even looking
at
The conditions are clearly seperated by || or by &&. It should be instantly clear that the comparison is higher than || and && in the order of operations. Something like "if (a == (b || c) > d)" wouldn't make sense anyway.
Do not mess this up with bracing things like if ((a == 0 || a > 2) && b < 0) Although the braces are not needed, it makes sense to set them.
() -> parentheses [] -> brackets {} -> braces
The parentheses are not needed? You better check your C book for operator precedence. && has higher precedence than ||, so in this case the parentheses are needed. This is also why using parentheses is a good idea, because you never know if the original author has any idea about operator precedence. The use of parentheses makes the original intention clear to other authors.
-- James Hawkins _______________________________________________ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev