But it seems the rule does not consider the above as good a null check as if (foo == null) Which I consider bad because it is all too easy to drop an =. C# only allows Booleans to be there, so should I change my convention?.
IMO, change your convention. This mistake is only possible in C# if
foo is a boolean, but in that case you shouldn't even be doing this to
begin with, but just a simple if (foo) or whatever.
Regards,
Alex
> --
> You received this message because you are subscribed to the Google Groups "Gendarme" group.
> To post to this group, send email to gend...@googlegroups.com.
> To unsubscribe from this group, send email to gendarme+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/gendarme?hl=en.
>
>
if (null == foo)
{
DoStuff();
}