O
orekinbck
Hi There
What convention do you use when naming an enumeration and variables
that use the enumeration?
I like plural/singular, for example:
public class Example
{
public enum VehicleTypes { Car, Truck, Motorbike };
static VehicleTypes VehicleType = VehicleTypes.Car;
}
But CodeAnalysis/FXCop complains about it:
CA1717 : Microsoft.Naming : If the name 'VehicleTypes' is plural,
change it to its singular form
It does not complain about:
public class Example
{
public enum VehicleType { Car, Truck, Motorbike };
static VehicleType MyVehicleType = VehicleType.Car;
}
But I don't think it reads well
Bill
What convention do you use when naming an enumeration and variables
that use the enumeration?
I like plural/singular, for example:
public class Example
{
public enum VehicleTypes { Car, Truck, Motorbike };
static VehicleTypes VehicleType = VehicleTypes.Car;
}
But CodeAnalysis/FXCop complains about it:
CA1717 : Microsoft.Naming : If the name 'VehicleTypes' is plural,
change it to its singular form
It does not complain about:
public class Example
{
public enum VehicleType { Car, Truck, Motorbike };
static VehicleType MyVehicleType = VehicleType.Car;
}
But I don't think it reads well
Bill