My opinion: If a loop does not require a body, I suggest to use
braces, rather than a semicolon, because it is less prone to
programmer error. I would be okay with either:

while (condition)
   {
   }

or

while (condition) {}

And of the two, I think the second one expresses the intent best.

But again: I'd like to see more feedback from the community first.

The second is unacceptable because it violates the basic principle of the coding standard because braces must always appear on separate lines.  I don't think we should modify that in any way.  Personal preference should not be a factor here.

This first is okay but I don't think it should be required.  It should be encouraged, but not required.  But far the majority of the existing code uses a semicolon but I change those to the first form whenever I encounter.

My vote:  Leave the coding standard alone.  I would vote -1 on any change to the coding standard.

(Maybe fix that bad example with no change to the text).


Reply via email to