---
title: "General Naming Convention in C#"  
description: "This articles describes about general naming conventions in C#."  
author: "Anupam Mishra"  
published: 2016-01-04  
updated: 2018-03-27  
canonical: https://www.mindstick.com/articles/11978/general-naming-convention-in-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 3 minutes  

---

# General Naming Convention in C#

This section describes general [naming conventions](https://www.mindstick.com/forum/145555/what-are-some-common-naming-conventions-used-in-programming) that related to word choice, guidelines on using abbreviations and acronyms, and recommendations on how to avoid using language-specific names and a class structure in our program. [Naming convention](https://www.mindstick.com/articles/23223/naming-convention-or-coding-standard) in different section are as follows:

##### Word Choice:

**1**. Do choose easily readable identifiers names.For example, a property named Vertical Alignment is more English readable than Alignment Vertical.\
**2**. Do favor readability over brevity. For example, the property name can ScrollVertically is better than ScrollableY(y- represents of y-axis)\
**3**. Do not use underscores, hyphens or any other non-alphanumeric characters.\
**4**. Avoid use of [Hungarian Notation](https://www.mindstick.com/forum/145563/what-is-hungarian-notation). It creates contradiction [as well as](https://www.mindstick.com/forum/156547/difference-between-max-width-and-width-as-well-as-max-height-and-height) ambiguity to the developer.\
**5**. Avoid using identifiers that conflict with keywords of widely used programming language.\
**6**. Do not use abbreviation or contradiction as part of identifiers names.\
**I**. Naming: “The beginning of wisdom is to call things by their proper name.” ― Confucius. “Meaningful” is the keyword in naming.\
**II**. Variables Names: Do not abbreviate variables names and names should be descriptive and meaningful.\
**III**. Namespace: In namespace, names should be meaningful and complete. Do not abbreviate. Using pascal Casing for giving names of the namespace.\
For example, Microsoft.Office.Powerpoint.If you want to categories namespace for separation, used plurals naming conventions.For example, stem.Collections;\
\
**IV**. Classes: Class names should be a noun and again meaningful avoid verbs. Do not prefix (“C”) in [class name](https://www.mindstick.com/forum/12871/how-to-get-class-name). \
**V**. Methods: Always use a verb-noun pair, unless the method operates on its containing class, we use a verbs. For parameter naming used Camel Casing (e.g. propertyUse).\
**VI**. [Private Member](https://answers.mindstick.com/qa/110885/what-is-the-indian-parliament-private-member-s-bill) Variables: if you are declaring private member variables in a class then we should adding prefix or suffix to all class level member variables with (underscore) m_ or _m.\
**VII**. Interfaces: Prefix the all interface with ‘I’ that should be reflect capability either a general noun or an –“-able”.\
**VIII.** Custom Attributes: used ‘Attribute’ keyword at the end of naming of [custom attribute](https://www.mindstick.com/interview/492/how-do-you-specify-a-custom-attribute-for-the-entire-assembly-rather-than-for-a-class).\
**IX**. [Custom Exception](https://www.mindstick.com/forum/159237/how-to-create-a-custom-exception-in-java-and-when-would-to-use-it): used ‘Exception’ keyword at the end of naming of custom Exception.\
**X**. Delegate: used ‘Handler’ keyword at the end of naming of [event handler](https://www.mindstick.com/forum/1371/c-sharp-dot-net-event-handler-delegate-question) and declaration of delegate with suffix ‘delegate’ keyword in naming.\
**XI**. Generics: We don’t use ‘Type’ as a suffix for naming in generics. Using ‘T’ as parameter for the strongly -typed object declaration.\
**XII**. Assembly DLL’s: Do choose names for your assembly dll that suggest large chunks of functionality, such as System.Data or for example, \
<Company_Name><Component_Name>.dll\
**XIII**. Enumeration: Do use singular type name for an enumeration unless its value are bit fields. We use ‘enum’ as a suffix for enum type naming.\
XIV. Miscellaneous:1. Avoid putting using statements inside a namespace.\
2. Do check spelling in comments3. Avoid fully qualified names.4. .All member variables should be declared at the top of class’s. Properties &methods should be separated by one line each.5. Declare [local variable](https://answers.mindstick.com/qa/104742/explain-local-variable) as close as possible to the first time they were used. Etc.\
\

---

Original Source: https://www.mindstick.com/articles/11978/general-naming-convention-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
