From d9886a0847eb52c7961f57119e75411b7127844c Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Wed, 1 Mar 2023 22:02:14 -0600 Subject: [PATCH] Update: Style guide documentation. --- documents/style_guide.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/documents/style_guide.txt b/documents/style_guide.txt index 1722675..ccd8e68 100644 --- a/documents/style_guide.txt +++ b/documents/style_guide.txt @@ -22,6 +22,7 @@ General Style Guides: - Commas in Sets. - Loops and Newlines. - Returns, Breaks, Continues, Gotos, and Newlines. + - Braces, Blocks, and One Liners. Specific Style Guides: - Return Code Names. @@ -144,6 +145,21 @@ Returns, Breaks, Continues, Gotos, and Newlines: As an exception, this newline requirement may also be disregarded when combined with a set of one-line if, then, and else conditions. +Braces, Blocks, and One Liners: + Most code, in general, is to be wrapped in bracks as appropriate for the needed or desired block structure. + + There are seveal cases where one-liners are highler recommended and encouraged. + Operations that change the flow of a block, like a code:"return" statement or a code:"break" state make sense to be in a single line. + + The one liner statements may also be on the immediate next line from relating code. + + An example of the one liner looks like\: + block:" + if (x == 0) return; + if (x == 1) break; + if (x == 2) continue; + " + Return Code Names: The return code names are C-language specific names used by this project as the status or return codes for functions and programs. To uniquely identify these, they follow the naming structure code:"(A)_(b)", where code:"(A)" is replaced with an upper-case character representing the project level (or name) and code:"(b)" is replaced with the lower-case status code name using words that are underscore separated. -- 1.8.3.1