Monday, 17 December 2012 14:36

naming conventions for Class, Variable, control, other names in code

Written by 
Rate this item
(0 votes)

in coding giving proper names to methods,classes,controls,
variables,others is neccessary and good programming practice.
think that a method name-show button click.

if it was written like showbuttonclick then most of viewers
could not understand because nouns and verbs were written with
no gaps at all and they will try to guess it wrong.if it is
written as - ShowButtonClick then those capitals shows a
specific verbs and nouns,easy to understand.

following are the naming conventions-
1.Class,namespace names should Start with capital.
example-public class Naming ,etc.

2.method names should start with capital-
example-public void Employee(string id, string name), etc.

3.all variable names of any type should start with small letter-
example-Naming namingObj,enum employeeType etc.

4.all windows controls like TextBox,DataGridView names should start
with small letter-
example-idTextBox,employeeDataGridView,etc.

also form names should start with a capital.

Read 2122 times
Super User

Email This email address is being protected from spambots. You need JavaScript enabled to view it.
Login to post comments