Here's my ENUM:
public enum ATI { Two = 0, Three = 1, Five = 2, }
I realize there are no strict conventions but normally would the files Two,Three and Five be in uppercase?
Enums are types, so they should be named using UpperCamelCase like classes. The enum values are constants, so they should be named using lowerCamelCase like constants, or ALL_CAPS if your code uses that legacy naming style.
Classic C doesn't use camel-case; I've written code in camel-case in C, and it looks weird (so I don't do it like that any more). That said, it isn't wrong - and consistency is more important than which convention is used.
Function, typedef, and variable names, as well as struct, union, and enum tag names should be in lower case.
Enums in Java (and probably enums in general) should be singular.
One should use Pascal case when they are typing enum types and values. This looks like
public enum Ati { Two = 0, Three = 1, Five = 2, }
According to Microsoft:
Identifier | Case | Example -------------------------------------------- Enumeration type | Pascal | ErrorLevel Enumeration values | Pascal | FatalError
The only thing that you should make all caps like that are constant/final variables.
When you have local variables you should always use camel case.
thisIsCamelCasedVariable = "ya baby";
More about enums: https://msdn.microsoft.com/en-us/library/4x252001(v=vs.71).aspx
More about naming conventions C#: https://msdn.microsoft.com/en-us/library/ms229043%28v=vs.100%29.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With