Of the two methods below, which do you prefer to read?
Is there any other way (better?) To check if the flag is set?
bool CheckFlag(FooFlag fooFlag) { return fooFlag == (this.Foo & fooFlag); }
and
bool CheckFlag(FooFlag fooFlag) { return (this.Foo & fooFlag) != 0; }
<h / "> Please vote for the method you prefer.
c # coding-style
Nescio
source share