On Wed, 18 Sep 2013 19:11:19 +0200, Jiří Zárevúcky <[email protected]> wrote:

On 18 September 2013 18:29, Dominik Taborsky <[email protected]> wrote:



That's not in the CStyle guide. And I prefer my style.


Perhaps it can be added there. But I don't think this is a matter of
style. It's just that the brackets are not necessary in this case.


If it's not in the official CStyle guide, how am I supposed to follow
rules? Jiri complained about me not following them, but how can I know?


I remember similar discussion in different context. The problem was,
whether it's ok to put unnecessary parentheses around expressions in
general.
The consensus that time was that more parentheses than necessary are
harmless. But only using parentheses when necessary assumes everyone who
reads the code knows all the operator priorities by hearth. Priorities of C
operators are not simple, and very few people could write down the whole
table from memory. Omitting parentheses can worsen readability of the code
significantly for some people, while adding more do not harm anyone.

So in short, IMHO there should be the least amount of parentheses that
everyone is comfortable with, not the least amount possible.

I totally agree with this. Thanks for saying it out loud.

Dominik

_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/listinfo/helenos-devel

Reply via email to