The Naming Guidelines for Coding from Microsoft form an important part of the
.NET Framework Design Guidelines dedicated to creating consistent readable maintainable code. These guidelines define standard naming procedures that guarantee project-wide consistency for classes and each of their elements including methods and properties.
Pascal Case and Camel Case
Microsoft adopts PascalCase naming conventions which extend to
classes and methods as well as properties and namespaces (CustomerAccount, GetUserName). According to Microsoft standards local variables and parameters should use camelCase notation (e.g., userEmail and orderId).
Class and Interface Naming
The names of classes must represent nouns or noun phrases and they need to explain their main functions (e.g. FileManager or DatabaseConnector). Interfaces that start with "I" indicate the definition of a contract through naming examples such as IShape and IDataProcessor.
Method Naming
PascalCase methods should contain verb phrases or verbs that detail their execution steps like CalculateTotal and SendEmail. Boolean-returning methods need naming prefixes which include "Is", "Can" or "Has" (valid examples are
IsValid() and CanExecute()).
Variable and Constant Naming
Raindrop Capital Must be employed for local variables in addition to method parameters because they follow the naming convention of
customerName and productPrice.
PascalCase should describe constants with either read-only or const annotations such as
MaxRetries and DefaultTimeout.
Namespace Naming
The hierarchical namespace structure should arrange elements according to
Company.Product.Module standards (Microsoft.AspNetCore.Mvc shows a proper example). It is best to avoid using generic name references such as Utils or Helpers when creating systems.
The standards help maintain code consistency which enables developers to read and maintain code more easily while working on large projects together efficiently.
Join MindStick Community
You need to log in or register to vote on answers or questions.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
The Naming Guidelines for Coding from Microsoft form an important part of the .NET Framework Design Guidelines dedicated to creating consistent readable maintainable code. These guidelines define standard naming procedures that guarantee project-wide consistency for classes and each of their elements including methods and properties.
Pascal Case and Camel Case
Microsoft adopts PascalCase naming conventions which extend to classes and methods as well as properties and namespaces (
CustomerAccount, GetUserName). According to Microsoft standards local variables and parameters should use camelCase notation (e.g., userEmail and orderId).Class and Interface Naming
The names of classes must represent nouns or noun phrases and they need to explain their main functions (
e.g. FileManager or DatabaseConnector). Interfaces that start with "I" indicate the definition of a contract through naming examples such as IShape and IDataProcessor.Method Naming
PascalCase methods should contain verb phrases or verbs that detail their execution steps like CalculateTotal and SendEmail. Boolean-returning methods need naming prefixes which include "Is", "Can" or "Has" (
validexamples areIsValid()andCanExecute()).Variable and Constant Naming
Raindrop Capital Must be employed for local variables in addition to method parameters because they follow the naming convention of
customerNameandproductPrice. PascalCase should describe constants with either read-only or const annotations such asMaxRetriesandDefaultTimeout.Namespace Naming
The hierarchical namespace structure should arrange elements according to Company.Product.Module standards (
Microsoft.AspNetCore.Mvcshows a proper example). It is best to avoid using generic name references such as Utils or Helpers when creating systems.The standards help maintain code consistency which enables developers to read and maintain code more easily while working on large projects together efficiently.