Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Class Naming Guidelines

.NET Framework 1.1

The following rules outline the guidelines for naming classes:

  • Use a noun or noun phrase to name a class.
  • Use Pascal case.
  • Use abbreviations sparingly.
  • Do not use a type prefix, such as C for class, on a class name. For example, use the class name FileStream rather than CFileStream.
  • Do not use the underscore character (_).
  • Occasionally, it is necessary to provide a class name that begins with the letter I, even though the class is not an interface. This is appropriate as long as I is the first letter of an entire word that is a part of the class name. For example, the class name IdentityStore is appropriate.
  • Where appropriate, use a compound word to name a derived class. The second part of the derived class's name should be the name of the base class. For example, ApplicationException is an appropriate name for a class derived from a class named Exception, because ApplicationException is a kind of Exception. Use reasonable judgment in applying this rule. For example, Button is an appropriate name for a class derived from Control. Although a button is a kind of control, making Control a part of the class name would lengthen the name unnecessarily.

The following are examples of correctly named classes.

Public Class FileStream
Public Class Button
Public Class String
[C#]
public class FileStream
public class Button
public class String

See Also

Design Guidelines for Class Library Developers | Base Class Usage Guidelines

Show:
© 2015 Microsoft