3 comments

[ 3.0 ms ] story [ 22.7 ms ] thread
Do you use any static analysis tool to verify these rules? For example, in the company that I work for we use MISRA C along with PC-lint (with some MISRA add-ons)
Not sure if I agree with the section about curly braces being vertically aligned. I have seen production code with both and it honestly comes down to personal preference. If you think about aligning the start of the function/if with the closing curly brace it kind of has the same effect as stacking the curly braces.
> When using a constant in a comparison expression, always place the constant on the left side of the comparison operator.

So, Yoda conditions, hm? I disagree on this one, your compiler should give you a warning about it.

But it doesn't matter, really. Guidelines themselves don't matter much. What matters is having them and sticking to them.