Given the following enum:
public enum Operations_PerHourType : byte
{
Holes = 1,
Pieces = 2,
Sheets = 3,
Strips = 4,
Studs = 5
}
When I run the Microsoft code analysis tool, it tells me:
CA1028 : Microsoft.Design : If possible, make the underlying type of ‘Enums.Operations_PerHourType’ System.Int32 instead of ‘byte’.
It will never have more than a couple possible values, so I declared it as a byte. Why would they recommend using int32? More values for future scalability? Or is there a performance improvement?
Have a look on MSDN for the reason.
Here is an excerpt: