My team has recently started using Lance Hunt's C# Coding Standards document as a starting point for consolidating our coding standards.
There is one item that we just don't understand the point of, can anyone here shed any light on it?
The item is number 77:
Always validate an enumeration variable or parameter value before consuming it. They may contain any value that the underlying Enum type (default int) supports.
Example:
public void Test(BookCategory cat) { if (Enum.IsDefined(typeof(BookCategory), cat)) {…} }