From 008797e6ab0bea91c30fdbc07e0751daf0bcaf45 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 28 Feb 2023 21:24:11 +0100 Subject: [PATCH] docs/developers.txt: update coding style guide about braces after if/while/for/... even for a single line --- docs/developers.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/developers.txt b/docs/developers.txt index fde3935a39..e0f5802e48 100644 --- a/docs/developers.txt +++ b/docs/developers.txt @@ -542,6 +542,12 @@ if (condition) { } ------------------------------------------------------------------------------- +NOTE: Earlier revisions of coding style might suggest avoiding braces if just +one line is added as condition/loop/etc. handling code. Current approach is to +welcome them even for single lines: on one hand, this confirms the intention +that only this line is the conditional code; on another, this minimizes the +context differences for later code comparisons, relocation, refactoring, etc. + Un-used variables and function arguments ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~