Comments should look like sentences by beginning with a capital and ending with a period (punctation).

I think this is a generally good recommendation, but sometimes a sentence fragment makes for a better comment, e.g.:

if (x == y) // false for NaN

Don't add explicit line breaks in the middle of a statement unless it is severely illegible even at wide editor window width (which current code tends to treats as about 120-180 characters).

Meh. We have a lot of code that breaks around "&&" and "||" operators, and I think it's OK.

Additional clauses in a conditional may be indented 4 extra spaces to visually separate them from the statement to be executed.


Like this
if (condition1
        && condition2)
    statement;

I think the majority of our code disagrees with this guideline. I disagree with it too. I would prefer the "&&" to be evenly indented with condition1, or the "&&" to be on the same line as condition1, and condition2 evenly indented with condition1.


Geoff
_______________________________________________
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to