[webkit-dev] unwritten rules of webkit style

Alexey Proskuryakov ap at webkit.org
Wed Sep 2 09:31:35 PDT 2009

02.09.2009, в 8:40, David Levin написал(а):

> Use enums instead of bools for parameters.  The one exception is  
> function names that start with "set" and take one parameter (e.g.  
> setAllowHeaders).

The purpose of this rule is to avoid having illegible function calls  
like doSomething(myData, true, 0, false, true). If a function is  
always called with a named variable, there is no practical reason to  
invent an enum for it.

> Constants
> Constants (static const int's) should be named just like a variable  
> and have no special prefix

As an aside, is there any practical difference between "static const"  
and "const" in C++? The only difference I'm aware of is that the  
former is deprecated in the standard.

> Indentation
> 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;

It doesn't look like there's a prevailing style for this currently.

- WBR, Alexey Proskuryakov

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20090902/d0ac811a/attachment.html>

More information about the webkit-dev mailing list