[webkit-dev] unwritten rules of webkit style

David Levin levin at chromium.org
Wed Sep 2 09:54:31 PDT 2009

On Wed, Sep 2, 2009 at 9:31 AM, Alexey Proskuryakov <ap at webkit.org> wrote:

> 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.

Yes, this is a C/C++ rule.  I do Objective C so seldom that I didn't think
about that, but the guideline should mention that.

> *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.

I've seen Darin Adler do this a few times.  I even unindented one instance
and got corrected before checkin, but perhaps this happens so seldom that it
isn't worth mentioning.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20090902/422efe7e/attachment.html>

More information about the webkit-dev mailing list