A good naming convention can greatly improve the readability and maintainability of your code. Good programming habits are developed from the beginning, many students who have just learned to program may feel that the cumbersome naming is not necessary, as long as the program can achieve the specified function can be, in fact, we must pay attention to these things from the beginning, so that good naming norms to form their own habits!
The following and simple introduction under the programming common programming centralized naming method, and mainly discusses in the next programming study, VB. NET programming is suitable for the method, I hope everyone in the future in accordance with the uniform norms to program, improve their programming efficiency!
1 ) Hungarian nomenclature
Hungarian nomenclature is characterized by prefixes. The type of the variable is indicated by a prefix. The first letter of the word after the prefix is capitalized, and the other letters are lowercase. The type of the variable can be known at the first sight of the variable name. For members in a class, append the prefix with " m_ " to the front, meaning member g_ " prefix, meaning global
btnsave , the name of the Password entry box txtpassword imglogo et cetera. So in the later vb.net programming we stipulate that we use the Hungarian nomenclature to name the files used in the control or the program, so that the reader knows exactly what controls we are using: The following is a common control abbreviation:
button (pushbutton) btn
ComboBox (combo box) CBO
CheckBox (check box) chk
Label (label) LBL
ListBox (list box) LST
MainMenu (Main menu) mnu
RadioButton (radio button) RDB
PictureBox (Graphics box) pic
TextBox (text box) txt
2 ) Camel Naming Law
Camelalso called the Hump name law. As the name implies, is the beginning of the word lowercase, followed by the first letter uppercase. So the two sides low middle high, looks like hump, hence the name. If the identifier has only one word, all lowercase is used. CamelThe naming method does not add prefixes that represent types. In theJavaof official standards,Camelnomenclature is used as the primary nomenclature. JavaAll library functions are usedCamelnaming law. In the. Netin the technical standard, it is recommended to use the variableCamelmethod names and class names using the followingPascalnaming law.
Camel examples of naming laws:
GetName functions that return names
Setage function to set age
3 ) pascal nomenclature
pascal nomenclature is also a popular naming method. .net pascal nomenclature. pascal nomenclature and camel getdate name Span style= "font-family: Song body" > et cetera.
Summary of vb.net collection of Octopus Brothers