From f1e6bc2eaa452412e8050f72ff14ad738dbe49bc Mon Sep 17 00:00:00 2001 From: Denton Liu Date: Wed, 24 Aug 2016 15:27:46 -0400 Subject: Update style-guide to use new style --- docs/style-guide.rst | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/style-guide.rst b/docs/style-guide.rst index c7b13efa..f4b419c0 100644 --- a/docs/style-guide.rst +++ b/docs/style-guide.rst @@ -273,17 +273,17 @@ No:: })); For ``if`` blocks which have an ``else`` or ``else if`` clause, the ``else`` should be -placed on it's own line following the previous closing parenthesis. The -parenthesis for the else block should follow the same rules as the other -conditional control structures. +placed on the same line as the ``if``'s closing brace. This is an exception compared +to the rules of other block-like structures. Yes:: if (x < 3) { x += 1; - } - else { + } else if (x > 7) { x -= 1; + } else { + x = 5; } @@ -296,7 +296,8 @@ No:: if (x < 3) { x += 1; - } else { + } + else { x -= 1; } -- cgit