Frog Frog Recommended: Procedures Development Specification.doc

xiaoxiao2021-03-06  70

First, the overall requirements

1. This specification must be strictly enforced to ensure the readability and maintainability of the source code.

2, all program files must have an comment text, and strictly written in accordance with the "Note Specification" in this specification.

Second, naming regulations

1.1 overview

1. Words must be used in English, and Chinese pinyin is not allowed.

2. If a noun, a single form must be used.

3, use the uppercase mixed format, write the first letter of several words in the connection.

4, must be within 3 to 30 letters.

5. If you use an abbreviation, you must use the abbreviation example of the appendix of this specification.

1.2 file naming specification

1. The file naming is used to use the main structure, the first letter is capitalized.

2, the name of the file and folder should accurately explain their use.

1.3 function naming specification

1, the function name and method name start with verbs, the first letters, such as SaveFilelog.

2. Include the description of the return value when the naming function is, such as getFileName.

3, class name and attribute name start with noun, first letters, such as EMPLOYEENAME.

4, attributes in different classes, if they have the same role, you must use the same name.

1.4 variable naming specification

1. All variables must have a prefix, prefixed 2-4 letters, all lowercase.

2. Avoid the same name as the data element in the data dictionary.

3. Avoid the same name, method name, class name, and attribute name.

4. Avoid a part of the variable name is another variable name.

5. The Boolean variable name should contain IS, such as BLNFILESFOUND.

1.5 constant naming specification

1. All letters of constant should be capitalized, and the words are connected to the underside.

Third, notes

2.1 Overview

1. Note The punctuation of Chinese and Chinese must use Chinese and Chinese.

2, the maximum length of each line is 100 characters.

3. Separate the comment with the comment separator with a space.

4, not allowed to add a box to the comment.

5. Write a comment while encoding.

6, important variables must be annotated.

7, variable annotations and variables in the same line, all comments must be aligned, separated from the variables to at least two Tab keys.

8. Typical algorithms must be annotated.

9, wherever the loop and logical branch must be written.

10, the annotation of the block or statement in the block or statement.

11. Before the code is delivered, temporary or unrelated comments must be deleted.

2.2 Comments for files and functions

1, the heads of the files and functions must have an overview annotation information.

2. Overview of files and functions The annotation should be indented.

3. File Overview Note Information must include the following:

(1) File name

(2) attribute

(3) Creating a person

(4) Creating a date

4. Function Overview The information must include the following:

(1) function

(2) Enter parameters, indicate significance and type

(3) Return value, indicate meaning and type

(4) author

(5) date

Fourth, program writing format

3.1 Space, blank line and indentation

1. Space must be used before and after the operator.

2. Space must be added after the comma of separating the array subscript and the function parameters.

3. A blank line must be used up and down.

4. Variable definition part and program statements must be used.

5. Use the logical structure of the program to display the program, the shrinkage amount is consistent and the Tab key is set, and the Tab key is 4 space characters.

6. Use of indentation:

(1) Function - End Function

(2) SUB - END SUB

(3) Do while - loop

(4) IF - Else - end IF

(5) SELECT CASE - END SELECT

(6) for - Next

3.2 SQL statement writing specification

1. When writing SQL statements, keywords must use uppercase (such as SELECT, WHER, etc.).

Data elements (tables, fields, views, etc.) must be written according to data dictionary;

2, open each SQL child in different rows.

3.3 Other specifications

1. Do not allow you to use purely unwaver numbers or strings. For example: for index = 1 to 7; should use a defined constant, such as for index = 1 to num_days_in_week.

Five Programming Guidelines

4.1 Variable usage specification

1. The global variable is not allowed.

2, one variable can only have one use; the use of variables must be consistent with the name of the variable.

3. All variables must be defined in front of class and functions, and classify.

4.2 Database Operation Specification

1. Find database tables or views, only those fields that do need.

2, use no closed subqueries instead of using associated subqueries.

3, clearly use the column name without using the sequence number of the column.

4.3 Object use specification

1. Create an object as much as possible and release it as early as possible.

4.4 Module Design Principle

1. The public function and class is not allowed.

2. The function function is single, and a function is not allowed to implement two and more than two functions.

3. The global variable cannot be used inside the function. To use global variables, it should be converted to a local variable.

4. Only the relationship is allowed between the function and the function, and there is no cross-relationship.

That is, there is only one directional call and called called, and there is no two-way call and called.

Attachment 1: Main nouns / verb Chinese - English comparison table

Annex attach

List list

Detailed detail

Edit Edit

Modify modify

Change Alter

转载请注明原文地址:https://www.9cbs.com/read-91495.html

New Post(0)