It's too bad that .NET enums aren't classes. This is not a problem with Java (JVM languages), although Scala got it wrong. Unfortunately, the author suggests using magic numbers when an inner enum would be better. There are other holes in the reasoning.
@VaughnVernon no doubt showing my ignorance of uptodate Java, but dotnet enums are valuable for at least being value types whereas java classes aren't?
@chrisfcarroll No, Java enums are sealed (final) types. .NET enums are type aliases over integers. Although F# supports common enums, it also supports discriminated unions, which are much more powerful. With C#, you can assign an ordinary integer to a variable of an enum type.
@chrisfcarroll No, Java enums are sealed (final) types. .NET enums are type aliases over integers. Although F# supports common enums, it also supports discriminated unions, which are much more powerful. With C#, you can assign an ordinary integer to a variable of an enum type.