Code specification brief description

zhaozj2021-02-16  59

One. I recommend in Hungarian Notation in the coding specification: This method is not only international coding standards, but it does make programmers reduce the maintenance of code, improve work efficiency, in Hungarian NOTATION (Hungarian Notes) In the middle, the variable has a descriptive name, such as count, classname, and the name starts with uppercase letters. If the variable is a multi-word name, each word first letter needs to be uppercase, then before the descriptive name, add the letter (type ablation) indicating the type of variable type, this is the programmer to know the type of variable, And it is not easy to forget. The form is as follows:

Global variable name = range prefix Underline (_) type prefix array prefix custom naming

Local variable name = Type prefix array prefix custom naming

Function Name = Type Prefix Custom Name

Control naming = control prefix custom naming

Control event naming = control name Underline (_) event name

Program file naming = Module name abbreviation custom naming

In addition, in the source code, the hierarchy and readability of the program cycle should be kept in the format of the latter (generally 4 to 5 empty characters).

Secondly, I recommend that type abbreviations are indicated by lowercase letters. The principle is as simple as possible, and other types of abbreviations avoid similar or identical to other professional priorities of the computer, so as to prevent programmers. E.g:

Data Type Prefix (Type Abbreviation) Example Boolean BLN or B BTRANSACTIONDATA INT INT or ILOOPFLAG DATE DT DTCREATEDATE

Control type prefix (type abbreviation) Example Combo CMB or CB CMBlookup Text Txt TxttotaRamount Radio Rd RdTypestatus Select Slt Sltbankno

two. I think there should be a standard or specification in the database table name and field name naming design:

Database table name = module name abbreviation custom naming

Field name = Type prefix custom naming

Note: I don't recommend that there is an underscore (_) in the database table name or field name, because it is easy to cause programmers' code errors.

three. Definition of variables and functions in the Java class

Class member variable name = m Underline (_) type prefix array prefix custom naming

Class member function name = Type prefix custom naming

Class event naming = class name Underline (_) custom naming

Other variables should be named according to the principle of variable naming

Note: The type prefix uses the abbreviation of the data type and is represented by lowercase letters;

Customize naming, use case-sensitive English abbreviations, asking for the names.

four. The structure of the program (selectively included in the actual situation)

Common interface style file (* .css)

Public JavaScript file (* .js)

Common Java class (Applet, Serverlet, Java Bean)

Common query box (* .lcf, scriptlet)

Programmer's own source code

Other common functions

Fives. Software interface

I think that in the same software product, the unified interface style is more able to identify teamwork spirit, the company's image, and also highlight the product's advantages and change the user's view, and it is more convenient to make users more convenient, simple. It is easy to skilled. In addition, I suggest that you need to support keyboards in our future software products (give a chance to habits users), mouse operations. For interface design, color matching I recommend refer to Window, the refresh interface is as least as possible. Here is some of my opinions: 1. The status of the interface: I think the interface status in the database software product can be divided into: new, modified, query, browse four states, and these states must be different, so that the level of software features can be embodied. The feeling of giving users is more reasonable.

2. The size of the interface: I don't recommend a software interface to use drag scroll bars to view the entire interface. I think that such results may lead to user operation, and our work efficiency is lowered, and the software's operating speed is reduced. I suggest that in future products, we classify the interface to determine the width of different types of interfaces. The height of the interface should be determined according to the actual situation (principle: to avoid vertical scroll bars, beautiful, decent, more The user is thinking).

3. Interface text, size, color, width, etc. I suggest a unified style (defined in * .css, I don't recommend writing source code, at least as much as possible)

4. The content of the interface, I recommend: interface descriptive text, control takes the left alignment principle, the content displayed in the control, the character takes left alignment, the number takes the right alignment (should retain a small number) principle. The validity of data input should be controlled by uniform style.

six. Common function

The utility function in software engineering can not only greatly improve the development efficiency, but also accelerate the speed of the program, so that the program is easy to maintain. And some public functions apply to multiple software products. Imagine what benefits will there be? In fact, I think the public function should be in the primary status in software products. Below is the classification of our utility:

Common function

User rights

Common search box

Common static data (business or interface)

Common control

Common class

......

Seven. Software documentation

I believe that everyone knows that the document is critical in software engineering, it is not only important (textual) description of the software business process, but also the effective basis for programmer writing, maintenance program code, is the tester's credential, is the user Wizard. I think the summary design, demand analysis, detailed design, maintenance guide, help (for users) is more important in software engineering. And I recommend that the programmer will write these documents (the writing style is to be one to).

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

New Post(0)