The variable name length should be only for the compiler, and the memory address is used for the final operation ~ It should not affect the performance, so we should try to make the variable name simple and easy to understand when writing the program; the variable name naming rules are actually to help understand and facilitate later maintenance. Do not covet the convenience of writing code, and make changes at last confused. However, if the variable name is too long, it is better to add a comment behind it.
Below I will write the variable naming rules commonly used in ASP. NET:
Variable naming rules:
Array ---- arr
Boolean ---- bln
Byte ----- byt
Char ----- chr
Datetime ----- dtm
Decimal ----- dec
Double ----- dbl
Integer ----- int
Long ----- lng
Object ----- obj
Short ------ shr
Single ----- sng
String ----- str
WebControls control command rules:
Cdrotator ----- adrt
Button ----- btn
Calendar ----- cal
Checkbox ----- chk
Checkboxlist ----- chkl
Comparevalidator ----- valc
Customvalidator ----- valx
Datagrid ----- dgrd
Datalist ----- dlst
Dropdownlist ----- drop
Hyperlink ----- lnk
Image ----- img
Imagebutton ----- ibtn
Label ----- LBL
Linkbutton ----- lbtn
ListBox ----- lst
Panel ----- pnl
Placeholder ----- plh
Radiobutton ----- Rad
Radiobuttonlist ----- RADL
Rangevalidator ----- valg
Regularexpression ----- vale
Validator ----- valv
Repeater ----- RPT
Requiredfieldvalidator ----- valr
Table ----- TBL
Tablecell ----- tblc
Tablerow ----- tblr
Textbox ----- txt
Validationsummary ----- Vals
XML ----- xmlc
Sqlclient naming rules:
Connection ----- con
Command ----- cmd
Parameter ----- parm
Dataadapter ----- dad (ADAP)
Datareader ----- dtr
Dataset ----- dst
Datatable ----- dtbl
Datarow ----- drow
Datacolumn ----- dcol
Datarelation ----- drel
Dataview ----- dvw
DataGridView ------ grdvw (dgrdvw)