[webkit-dev] Switch statement indentation

Peter Kasting pkasting at google.com
Wed Dec 2 20:58:38 PST 2009


On Wed, Dec 2, 2009 at 8:05 PM, Maciej Stachowiak <mjs at apple.com> wrote:

> I believe one rule that could work is something like this:
>
> - Indent case labels inside a switch two spaces.
> - Indent actual statements inside a switch four spaces.
> - In the case where a case label is followed by a block, include the open
> brace on the same line as the case label and indent the matching close brace
> only two spaces (but still 4 spaces for the contained statements).
>

This is precisely the rule that the Google C++ Style Guide uses (
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Loops_and_Switch_Statements).
 I think it works well.  I support it.

PK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20091202/611913c4/attachment.html>


More information about the webkit-dev mailing list