From: Kevin Day Date: Thu, 2 Mar 2023 04:02:14 +0000 (-0600) Subject: Update: Style guide documentation. X-Git-Tag: 0.6.4~32 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=d9886a0847eb52c7961f57119e75411b7127844c;p=fll Update: Style guide documentation. --- 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.