Of the two methods below, which do you prefer to read?
Is there another (better?) way to check if a flag is set?
bool CheckFlag(FooFlag fooFlag) { return fooFlag == (this.Foo & fooFlag); }
And
bool CheckFlag(FooFlag fooFlag) { return (this.Foo & fooFlag) != 0; }
Please vote up the method you prefer.
The two expressions do different things (if fooFlag has more than one bit set), so which one is better really depends on the behavior you want: