Skip to content

Commit b73921e

Browse files
committed
docs/developers.txt: update coding style guide about braces after if/while/for/... even for a single line
1 parent 3ecca8d commit b73921e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/developers.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,12 @@ if (condition) {
542542
}
543543
-------------------------------------------------------------------------------
544544

545+
NOTE: Earlier revisions of coding style might suggest avoiding braces if just
546+
one line is added as condition/loop/etc. handling code. Current approach is to
547+
welcome them even for single lines: on one hand, this confirms the intention
548+
that only this line is the conditional code; on another, this minimizes the
549+
context differences for later code comparisons, relocation, refactoring, etc.
550+
545551
Un-used variables and function arguments
546552
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
547553

0 commit comments

Comments
 (0)