New API Design Guideline: Enums


There are a few topics that are likely to generate a long thread of discussion whenever they come up Exceptions, finalization, and Enums are among them    Kit George spent a fair amount of time working with folks across WinFX on how to “correctly” use Enums.  There is of course, more to say here, but I think this is a good first start.  As always, love to have your feedback.


http://blogs.msdn.com/kcwalina/archive/2004/05/18/134208.aspx


 

Comments (5)

  1. Daniel Pratt says:

    What would be the downside to changing the way values are automatically assigned to enum "members" (without an explicit value assignment) if the "Flags" attribute is present?

  2. Ken Brubaker says:

    Brad Abrams clued us in to the revised Enum usage guidelines.

  3. Nicholas Allen says:

    One thing I don’t like about these guidelines is that modifying an enum is considered acceptable. Most strong enum implementations (which admittedly .net is not trying to provide) define this as a compatibility breaking change. The guideline even goes on to say

    Developing with the suspected future versioning of an enum in mind is the required attitude.

    Which is pretty much acknowledging that changing a widely known enum type will break a lot of code.