From b2711c940fc63c37197a0e6fdbb338d434678fb8 Mon Sep 17 00:00:00 2001 From: Benjamin Michaelis Date: Wed, 9 Feb 2022 15:07:38 -0800 Subject: [PATCH 1/2] Add enum guideline --- docs/Guidelines(8th Edition).xml | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/Guidelines(8th Edition).xml b/docs/Guidelines(8th Edition).xml index 289c88f2..9dd43abf 100644 --- a/docs/Guidelines(8th Edition).xml +++ b/docs/Guidelines(8th Edition).xml @@ -45,6 +45,7 @@ "AVOID creating enums that represent an “incomplete” set of values, such as product version numbers." AVOID creating flag enums where the zero value has a meaning other than “no flags are set.” AVOID enums that contain a single value. + DO make the enum name itself to be singular (unless the enums are bit flags). "DO provide a value of 0 (none) for simple enums, knowing that 0 will be the default value when no explicit initialization is provided." AVOID creating “reserved for future use” values in an enum. DO use the FlagsAttribute to mark enums that contain flags. From 4c47f926191cbdf76d40bd02da54e989eac0aa74 Mon Sep 17 00:00:00 2001 From: Benjamin Michaelis Date: Wed, 9 Feb 2022 15:15:21 -0800 Subject: [PATCH 2/2] Minor severity change --- docs/Guidelines(8th Edition).xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Guidelines(8th Edition).xml b/docs/Guidelines(8th Edition).xml index 9dd43abf..bb881b3d 100644 --- a/docs/Guidelines(8th Edition).xml +++ b/docs/Guidelines(8th Edition).xml @@ -45,7 +45,7 @@ "AVOID creating enums that represent an “incomplete” set of values, such as product version numbers." AVOID creating flag enums where the zero value has a meaning other than “no flags are set.” AVOID enums that contain a single value. - DO make the enum name itself to be singular (unless the enums are bit flags). + DO make the enum name itself to be singular (unless the enums are bit flags). "DO provide a value of 0 (none) for simple enums, knowing that 0 will be the default value when no explicit initialization is provided." AVOID creating “reserved for future use” values in an enum. DO use the FlagsAttribute to mark enums that contain flags.