What is a good naming convention to differentiate a class name from a property in C#?
Posted
by Andy Stampor
on Stack Overflow
See other posts from Stack Overflow
or by Andy Stampor
Published on 2010-05-18T22:28:07Z
Indexed on
2010/05/18
22:30 UTC
Read the original article
Hit count: 217
c#
|naming-conventions
I run into this frequently enough that I thought I'd see what others had to say about it.
Using the StyleCop conventions, I find that I often have a property name that is hard to make different than the class name it is accessing. For example:
public class ProjectManager
{
// Stuff here
}
public class OtherClass
{
private ProjectManager ProjectManager { get; set; }
}
It compiles and runs, but seems like it would be an easy way to confuse things, even with the use of "this".
© Stack Overflow or respective owner