---
title: "Naming convention or Coding Standard"  
description: "Naming convention or Coding Standard  Programming Standard.  Here, I will explain the Naming Convention and Coding Standard of C # for best practice o"  
author: "Anonymous User"  
published: 2018-10-25  
updated: 2019-09-07  
canonical: https://www.mindstick.com/articles/23223/naming-convention-or-coding-standard  
category: "c#"  
tags: ["c#", "asp.net mvc"]  
reading_time: 4 minutes  

---

# Naming convention or Coding Standard

**Coding Standard**

Today, when you are developing an application, I will explain to you the [Naming Convention](https://www.mindstick.com/forum/156785/what-is-naming-convention-in-sql-server-explain-how-to-use-naming-convention-in-sql-server) of C # [Coding Standards](https://www.mindstick.com/forum/145574/what-are-coding-standards-in-software-engineering) for best practice of [C#](https://www.mindstick.com/articles/23213/overview-and-history-of-c-sharp) coding.

## Types:-

CamelCase (camelCase): In this (camelCase) the first letter of the word always in small letter and after that each word with capital letter.

Pascal Case (PascalCase): In this (PascalCase) the first letter of every word is in capital letter.

Underscore Prefix (_underscore): For underscore (_), the word after _ use camelCase term.

![Naming convention or Coding Standard](https://www.mindstick.com/mindstickarticle/e29471c9-b34d-41f4-910d-ddd3381acab8/images/9623e3d1-078e-4a83-b953-7f8322b04dad.png)

## Congenital Datatype

![Naming convention or Coding Standard](https://www.mindstick.com/mindstickarticle/e29471c9-b34d-41f4-910d-ddd3381acab8/images/434ca0a1-c011-4f1a-832f-4061b26b7773.png)**\**

Always use native datatype instead of .NET. Example, use int instead of Int16 or Int32.

Do not use the short form. Use the name, address, salary etc. instead of nam, addr, sal.

Do not use single character variable names like a, b, c, etc. Use names like index and temp.

Do not use underscores (_) in variable names.

Namespace names should follow the standard pattern.

According to my own definition, the following are the characteristics of the code.

- Reliable
- Maintainable
- Efficient

Here the naming conferences, coding standards and the best practices described in this document have been compiled by our own experience and by mentioning various Microsoft and non-Microsoft guidelines.

Purpose of coding standards [and best practices](https://www.mindstick.com/articles/341641/scaling-databases-concepts-strategies-and-best-practices)

To develop a reliable and maintainable application, you must be follow coding standards and best practices.

The [naming conventions](https://www.mindstick.com/forum/145555/what-are-some-common-naming-conventions-used-in-programming) or coding standards and best practices described in this document are compiled from my own experience and by referring to various Microsoft and non-Microsoft guidelines.

There are various standards exists in the programming area. None of them is wrong or bad and you can follow the code of any of them.

And most importantly, you choose a standard approach and also ensure that everyone is following it.

## [Namespace](https://www.mindstick.com/articles/12552/namespace)

Always use PascalCase for a namespace.

namespace StanderedProgramming.Domain

**Methods** \

Always use PascalCase for method names. The maximum 7 parameters for the method should be used.

![Naming convention or Coding Standard](https://www.mindstick.com/mindstickarticle/e29471c9-b34d-41f4-910d-ddd3381acab8/images/611b2c23-1794-472f-a324-71214763d9ad.png)\

**Note**: Don't use a name as all character in CAPS.

## Class

Always use PascalCase for class names. Try to use a noun or noun phrase for a class name.

![Naming convention or Coding Standard](https://www.mindstick.com/mindstickarticle/e29471c9-b34d-41f4-910d-ddd3381acab8/images/0e5c5630-a334-417b-928f-4c0461c3beec.png)\

## Arguments and Local Variable

We should always use camelCase for method arguments and local variables. we should not use [Hungarian notation](https://www.mindstick.com/forum/145563/what-is-hungarian-notation) for any variables.

![Naming convention or Coding Standard](https://www.mindstick.com/mindstickarticle/e29471c9-b34d-41f4-910d-ddd3381acab8/images/5520bcce-1dc1-445c-8f20-736ee8ff5177.png)\

**Note**: Don't use the short form for any words and don't use an underscore (_) in between any name.

## Property

Use PascalCase for the property. Never use Get and Set as a prefix with the property name.

![Naming convention or Coding Standard](https://www.mindstick.com/mindstickarticle/e29471c9-b34d-41f4-910d-ddd3381acab8/images/bc492dfd-0f90-4b31-81d8-db03558fca85.png)\

## Interface

Always use the letter "I" as a prefix with the name of an interface. After letter I, use PascalCase.

![Naming convention or Coding Standard](https://www.mindstick.com/mindstickarticle/e29471c9-b34d-41f4-910d-ddd3381acab8/images/0e5f1218-8489-43bc-b111-8c69187e2893.png)

## Private Member Variable

Always try to use camelCase terminology prefix with an underscore ( _ )

![Naming convention or Coding Standard](https://www.mindstick.com/mindstickarticle/e29471c9-b34d-41f4-910d-ddd3381acab8/images/95db7609-1576-4813-8fe1-f5f30d880362.png)\

## Member variable

Declare member variable at the top of the class, if the class has static member then it will come at the topmost and after that other member variable.

![Naming convention or Coding Standard](https://www.mindstick.com/mindstickarticle/e29471c9-b34d-41f4-910d-ddd3381acab8/images/6089ce43-0d89-4fbc-97b6-c49b79c877e9.png)\

## Enum

Always use a singular noun to define Enum.

![Naming convention or Coding Standard](https://www.mindstick.com/mindstickarticle/e29471c9-b34d-41f4-910d-ddd3381acab8/images/9c43fbd1-28d1-4582-9cca-efaaa3d48c10.png)

\

| btn | Button |
| --- | --- |
| cb | CheckBox |
| cbl | CheckBoxList |
| ddl | DropDownList |
| fu | FileUpload |
| hdn | HiddenField |
| txt | TextBox |
| hlk | Hyperlink |
| img | Image |
| lbl | Label |
| lbtn | LinkButton |
| mv | MultiView |
| pnl | Panel |
| dtg | DataGrid |
| imb | ImageButton |
| lst | ListBox |
| dtl | DataList |
| rep | Repeater |
| rdo | RadioButton |
| rdl | [RadioButtonList](https://www.mindstick.com/forum/12867/adding-data-to-a-radiobuttonlist-in-a-random-order) |
| phd | Placeholder |
| tbl | Table |
| gv | GridView |
| dtv | DetailView |
| fv | FormView |

![Naming convention or Coding Standard](https://www.mindstick.com/mindstickarticle/e29471c9-b34d-41f4-910d-ddd3381acab8/images/3b69a6a6-54ba-4427-afa0-01191efd68ac.png)\

Today we learned coding standard naming conventions in C#. Thanks for reading this article, hope you enjoyed it.

---

Original Source: https://www.mindstick.com/articles/23223/naming-convention-or-coding-standard

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
