Update style guide about class enums
authorMark Abraham <mark.j.abraham@gmail.com>
Thu, 25 Apr 2019 08:04:02 +0000 (10:04 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Thu, 25 Apr 2019 08:04:02 +0000 (10:04 +0200)
Change-Id: Icf6ddde8ce030bd5ed737152a8c58daad87ff991

docs/dev-manual/naming.rst

index 392e965365339f4d0db30e355e4ea503dab149a5..37640b5017171cf1911ab5ee01af6db3c8167450 100644 (file)
@@ -75,9 +75,9 @@ C code
 C++ code
 --------
 
-* Use CamelCase for all names.  Start types (such as classes, structs, and
-  typedefs) with a capital letter, other names (functions, variables) with a
-  lowercase letter.
+* Use CamelCase for all names.  Start types (such as classes, structs,
+  typedefs and enum values) with a capital letter, other names (functions,
+  variables) with a lowercase letter.
   You may use an all-lowercase name with underscores if your class closely
   resembles an external construct (e.g., a standard library construct) named
   that way.
@@ -102,7 +102,9 @@ C++ code
   variables and an ``e`` prefix for enumerated variables and/or values).
   Instead, make the names long with a good description of what they control,
   typically including a verb for boolean variables, like ``foundAtom``.
-* It is a good idea to include the name of the enum type
+* Prefer class enums over regular ones, so that unexpected conversions to
+  int do not happen.
+* When using a non-class enum, prefer to include the name of the enumeration type
   as a base in the name of enum values, e.g., ``HelpOutputFormat_Console``,
   in particular for settings exposed to other modules.
 * Prefer to use enumerated types and values instead of booleans as control