[webkit-dev] unwritten rules of webkit style
ggaren at apple.com
Wed Sep 2 11:23:09 PDT 2009
> 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)
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev