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.
On Mon, Feb 16, 2009 at 12:54 PM, Timo Kreuzer <timo.kreuzer@web.de> wrote:() -> parentheses
> 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.
>
[] -> 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