Naming Enum Types

Problem
You’re interested in naming guidelines for enum types.

Solution
Follow these rules when assigning names to enums:
1. Assign a singular name if the enum type’s members are never combined with | or + operators.
2. Assign a plural name if the enum type’s members will be combined with | or + operators (bit-coded).
c. Don’t use special suffixes when naming enum types.

Comments
Enter each enum value on its own line.

Examples

public enum Sex {
    Male,
    Female,
    Unknown
}

[Flags()]
public enum Sex {
    Male = 1,
    Female = 2,
    Unknown = 3
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s