summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Williams <patrick@stwcx.xyz>2017-01-25 21:51:29 -0600
committerPatrick Williams <patrick@stwcx.xyz>2017-01-25 21:54:56 -0600
commit45da61966ceecd78c4c56ffa138daa26fa2091d7 (patch)
tree8cf3284a484bf7e45bf5e9a62fcc9d62fbc41067
parent0274d9ca981ebf0eeefc678a2da1bdd721b1e4bf (diff)
downloadopenbmc-docs-45da61966ceecd78c4c56ffa138daa26fa2091d7.tar.gz
openbmc-docs-45da61966ceecd78c4c56ffa138daa26fa2091d7.zip
cpp-style: Special note on acronyms
There was a discussion in code reviews on how acronyms should be handled. In DBus interfaces, we have used UpperCamelCase through-out and therefore acronyms are always UPPERCASE in DBus interfaces specifically. There was an attempt to carry this forward into C++ style, which caused a contradiction between acronyms-always-uppercase and variables-are-lower-case. Clarify this to indicate that acronyms should always be same-case and are UPPER or lower depending on the context. Change-Id: I5bf19595ba38405d1d5d629f8ce854bbc47af8cf Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
-rw-r--r--cpp-style-and-conventions.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/cpp-style-and-conventions.md b/cpp-style-and-conventions.md
index 442d6ef..91e8119 100644
--- a/cpp-style-and-conventions.md
+++ b/cpp-style-and-conventions.md
@@ -259,6 +259,16 @@ void foo()
### Naming Conventions.
* We generally abstain from any prefix or suffix on names.
+* Acronyms should be same-case throughout and follow the requirements as
+ in their appropriate section.
+
+```
+/// Correct.
+SomeBMCType someBMCVariable = bmcFunction();
+
+/// Wrong: type and variable are mixed-case, function isn't lowerCamelCase.
+SomeBmcType someBmcVariable = BMCFunction();
+```
#### Files
OpenPOWER on IntegriCloud