Program | programmer | Specification 4.2 variable and constant naming conventions
Array arr arrshoppinglist
Boolean bln Blnispostback
Byte byt Bytpixelvalue
Char CHR Chrdelimiter
DateTime DTM Dtmstartdate
Decimal Dec decaverageheight
Double Dbl Dblsizeofuniverse
Interger int Introwcounter
Long LNG
Object obj
Short SHR
Single SNG
String Str
4.3 Function procedure Naming specification
4.3.1 Unified word order:: Verb + rank
4.3.2 The first letter of the word and the name should be able to express their purpose (or meaning).
The 4.3.3 parameter needs to indicate whether ByVal or byref (whether the argument is passed by value or by address)
4.4 Class Naming conventions
Classes declared by class, must be named after nouns or noun phrases to reflect the role of the class
Ii. when a class is an attribute, at the end of the attribute, when the class is an exception (Exception), End with Exception:
Class colorsetexception
Class Causeexceptionattribute
Iii. when a class simply has an object instance (global object, such as application, etc.), it must end with class, as
Class Screenclass
Class Systemclass
Iv. when the class is used only as a base class for other classes, as appropriate, end with base:
MustInherit Class Indicatorbase
V. If the defined class is a form, then the name must be appended with the suffix form, and if it is a Web form, the suffix page must be appended:
Class printform:inherits form ' * Windows Form
Class startpage:inherits Page ' * Web Form
Vi. module is not a type, except that his name must be named after the noun, it must be suffix module
: Module Sharedfunctionsmodule
Five Design specifications:
5.1 object is assigned to a variable or control, you need to determine if the object is nothing:
If not Customer are nothing Then
Else
' Missing customer data is handled by the account and logon pages
End If
5.2 Use meaningful constants instead of meaningless values when using a DataSet object:
Correct: With Customer.tables (customerdata.customers_table). Rows (0)
5.11 Even functions that do not return a value always accept the return value of the function
5.12 returning function values using return
Incorrect usage: priavire function myfunction () as Boolean
MyFunction =true
End Sub
Correct usage: priavire function myfunction () as Boolean
return True
End Sub
5.13 Programming rules for constants
All constants precede with the prefix C_ and range indicator
For example: The process of const C_INTERESTRATE=6
Module (private) Private Const mc_intersrate=6
Global: Public Const gc_intersrate=5
5.14 never use + to do the string connector, to use the & symbol
5.15 use blank lines to group related statements
Inserts a blank line before and after each loop body in the If ... then, select Case structure
After you declare a set of variables, insert a blank line after the statement group that executes the same task
Insert two blank lines between procedures
5.16 Define a definite range for each process
Incorrect usage: Sub Disp;lay confiirmationmessage
End Sub
Correct usage: Public Sub Disp;lay confiirmationmessage
End Sub
... there are also n all the lessons in the actual programming are not listed, I hope we can sum up as their own norms of the. s ...., ... and all of them.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.