[Previous] [Contents] [Next]

Class Members


This is probably the stickiest issue with regards to C# developers. Those of us coming over from C++ and MFC are accustomed to prefixing member names with m_. However, I would recommend using camel casing, in which the first letter is not capitalized. That way if you have a method that takes as an argument something called Foo, you can differentiate it from the internal representation of that variable by creating the internal member named foo.

It's redundant to prefix a member name with the class name. Take, for example, a class name of Author. Instead of creating a member named AuthorName,which would then be written out as Author.AuthorName, instead use Name as the member name.

[Previous] [Contents] [Next]