Specification for ASP Development-doc

Source: Internet
Author: User
Tags constant function definition lowercase
In order to standardize program code writing, improve the readability of the code, reduce maintenance costs, improve office efficiency, the proposed program in the following several specifications:
First, the Unified VBScript and ASP program writing specifications:
(i) Variable naming rules:
Since it is not necessary to declare variables in ASP and VBScript, and not to declare the types of variables, in order to improve the readability of the code and develop a good development habit, the uniform Rules for variable naming for this system are as follows:
1. Use Dim, public, private declaration variables;
For example: Dim istudentnum
2. Expression of variable type:
A, Integer variable: Start with the lowercase letter I, followed by the variable designator, the first letter of the English word capitalized.
For example: The following declares a variable that stores the database record
Dim Iresordsetnumber
b, single-precision entity variables: Starting with the lowercase letter F, followed by the variable designator, the first letter of the English word capitalized.
C, double entity variable: Beginning with lowercase d, followed by variable designator, the first letter of the English word should be capitalized.
D, character variables: The beginning of the lowercase letter s;
E, Boolean variables: beginning with lowercase b;
F, array variables: Array type + "_" + "Array" + "_" + "Variable indicator"
For example, define an array that stores student scores (stored single-precision entity type variables)
Dim F_array_studentmark
3. The variable designator should conform to the Mark Standard, and it is easy to understand, try to use English words instead, try to avoid using abbreviation or shorthand.
For example, the string variable that stores the alumni Address Book is defined as:
Dim sschoolfellowaddresslist;
Although this definition is troublesome in the input, it greatly improves the readability of the program, which is known by its variable naming. It is also more convenient when making variable lookup.
Speed and performance are not always the same, in order to facilitate the latter we will only sacrifice speed.
4. A comment that adds a variable function definition after a variable definition.
(ii) constant naming rules:
The type shows the same as above, and the difference is that all subsequent identifiers are capitalized, for example:
Defines a character type constant for a storage language type:
Const slanguage_type= "Chinese"
(iii) Functional functions, process naming rules:
1. Use function declaration functions, use sub Declaration procedure;
2. The first letter of the function name or procedure name is capitalized, and the first letter of each subsequent word is capitalized.
For example:
Function Checkvalidityofinput (Sstuentmark)
' Write code here
............
End Function
3. Function name or procedure name to be easy to read, simple and clear.
4. In front of the function of the comment, explain function function, parameter description, creation date, modification date, change reason, creator, modify person and so on related information.
Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.