[Mono-dev] more Gendarme rules

Aksel Qviller aksel_qviller at fastmail.fm
Mon Jun 11 11:28:15 EDT 2007


Shouldn't the compiler give a warning on cyclic properties as it is such
a clear error? Because the call can be found to have no side effects and
passes no changed params, it must be easy to deem infinite recursive and
to catch at compile-time. Note that Microsoft requires camel-cased
fields only to pass the CLS compliance - private fields can be named
either way you want, however protected or public fields should be
camel-case to support subclasses in other languages. I see that csc does
not warn on this.

On Fri, 8 Jun 2007 14:04:04 -0400, "Vladimir Giszpenc"
<vladimir.giszpenc at gmail.com> said:
> Hi,
> 
> In programming spelling counts and case usually matters as well.  A
> perfect example is in properties.
> 
> 
> //Microsoft says we should no longer use m_ or hungarian notation
> //note the lower case first letter
> private Type propertyName;
> 
> 
> public Type PropertyName
> {
>    get
>    {
>       return this.PropertyName;  //this will crash your app
>    }
>    set
>    {
>       return this.PropertyName = value;  //this will crash your app
>    }
> }
> 
> This is fairly easy to find, but should also be easy find by some code
> analyzer.  Gendarme rule or compiler warning...  Either way, I await
> the next MonoDevelop with baited breath.
> 
> Thanks,
> 
> Vlad
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
-- 
  Aksel Qviller
  aksel_qviller at fastmail.fm




More information about the Mono-devel-list mailing list