I was reading this article: Designing Flags Enumerations @ msdn and it says

Combining flags enumeration values is an intermediate skill that should not be required for developers implementing common scenarios.

I think flags enumeration are awesome - something I learned about during my experience with C.

Why does it seem like this article is cautioning developers away from what I consider to be a useful (and not complex) skill?

2 Answers 2


As with many computing concepts, those who understand them don't find them difficult. You're among those people; congratulations!

That doesn't change the fact that bitwise arithmetic seems strange and hard to understand to many people, because it uses a language element (numbers) that they are used to handle in one way (for absolute magnitude) in a very different way (with different meanings for each bit, regardless of their 'value' in the normal number system.)

Yes, there are people to whom this is difficult, and yes, there are a lot of positions that can be filled by people who can't be bothered to learn bit arithmetic. That's what "intermediate" means here.


The article says

Consider providing special enumeration values for commonly used combinations of flags.

Of course, it is not really hard to combine different flags using the "|" operator, but providing special enumeration values has the following advantage:

  • easier to read:

    MyEnumeration.MyFlag1 | MyEnumeration.MyFlag2 | MyEnumeration.MyFlag3

    tends to get much more lengthy than


  • it makes immediately clear that the specific combination of flags is a legal combination (which may or may not be the case for every other combination)

Nevertheless, I read this sentence from the article not like "don't do this, never ever", only like "make it easier for the common case". There's nothing to say against having no special enum value for a rarely used combination.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.