The problem is that it actually does not help in real problem cases, when there are several arguments, and it is unclear what the flag controls.
If you follow the rule that you should “avoid double negatives,” then simple single booleans are in order:
public static void Foo(bool useBaz) public static void Foo(Ability useBaz)
Then Foo(true) , verses Foo(Ability.Enabled) and Foo(false) , verses Foo(Ability.Disabled) really very obvious to most.
However, when you click on a method, for example:
public static void Foo( bool useBaz, bool barIsHigh, bool useFlibble, bool ignoreCase)
then it doesn’t matter if you use the logical or general enumerations that they still look on this site:
Foo(false,true,false,false); Foo(Ability.Enabled,Ability.Enabled,Ability.Disabled,Ability.Enabled);
Nothing happens.
Using specific listings for the case in question:
enum BarOption { Off, On } enum BazConsidered { Low, High } enum FlibbleOption { Off, On } // for case sensitivity use System.StringComparison
then you get
Foo(Bar.On, BazConsidered.Low, FlibbleOption.On, StringComparison.IgnoreCase );
or, if all are simple Boolean states and are likely to remain so, then a flag enumeration is best.
[Flags] enum FooOptions { None = 0, UseBaz = 1, BazConsideredHigh = 2, UseFlibble = 4, }
Then you will have:
Foo(FooOptions.UseBar | FooOptions.UseFlibble, StringComparison.IgnoreCase);
The appropriate choice of “active” flags so that you specify only what is unusual, then leads to highlighting “unusual” customs.