I wonder what the benefits of using Enum-flags instead of boolean fields (besides a better performance and cleaner code)...
Asked
Active
Viewed 369 times
1
-
http://stackoverflow.com/questions/8447/enum-flags-attribute – Christian Phillips Aug 09 '13 at 19:25
-
3Isn't better performance and cleaner code good enough for most features? – itsme86 Aug 09 '13 at 19:33
2 Answers
1
Flags enumerations are used for masking bit fields and doing bitwise comparisons. They are the correct design to use when multiple enumeration values can be specified at the same time.
As metioned above it is nothing more than correct design, but i guess this is what matters the most.

Ehsan
- 31,833
- 6
- 56
- 65
0
I think it's good that if you use flags you won't need many boolean parameters on a method if you have to pass many values. The flags make it easier to overload the method, too.

HerpDerpington
- 3,751
- 4
- 27
- 43