Code specification for BCB software

Source: Internet
Author: User

Objective:

By establishing code specification, forming BCB Development Group Coding Convention, improving program reliability, readability, modification, maintainability, consistency, guaranteeing the quality of program code, inheriting software development results and making full use of resources. Improve the inheritance of the program, so that the results of work between developers can be shared.

Software coding should follow the following guidelines:

1. Follow the development process, under the guidance of the design of code preparation.

2. Code to achieve the design of the function and performance as the goal, the need to correctly complete the design requirements of the function to achieve the design performance.

3. The program has a good program structure, improve the encapsulation of the program is good, reduce the coupling degree of the program.

4. Program readability is strong, easy to understand, easy to debug and test, can be tested well.

5. Easy to use and maintain, good modification, expansibility, good reusability/portability.

6. Less resources to complete the task at a low cost.

7. Improve the efficiency of code execution without reducing the readability of the program.

The description of this specification mainly takes Borland C + + Builder language as an example

First, the specification: The following to the specification for detailed description.

1: File management of the source program:

A) Organization: Each program file unit is typically composed of files such as. cpp,. DFM and. h, and the Public Declarations section of the unit is placed in the. h file. Division units are mainly based on the class, in principle each of the larger classes should be a separate unit, but in a small class and a number of small classes close to the case can also be a number of classes of a unit (recommended only for the more common classes have been tested in detail).

b) Naming: The original program file naming takes a meaningful format. For example: For the landing program, three files should be named this way,. cpp is Login.cpp. DFM is LOGIN.DFM. h is Login.h

c) File structure: Each program file consists of three parts, title, content, and additional description.

(A) Title: The first note of the document, which includes: program name, author, version information, brief description, etc., should be more detailed when necessary (will be separated by blank lines in this section).

(B) Content: The order of the source code portion of the file is essentially the sequence of preprocessing statements, type definitions, variable definitions, function prototypes, function implementations (. cpp files only). Main, WinMain, control registration functions should be placed at the end of the content section, the definition of the class in private, Protected, pubilic, __pubished order, and try to keep each part of only one, in each section by data, functions, attributes, events in the order.

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.