Chapter 8 of [database programming Standard Specification series]: code comments

Source: Internet
Author: User
The reason for not writing comments: it takes a lot of time to write comments (the customer is more difficult to understand the bad code) 8.1 programming principle 8.1.1 excellent comments, add information 8.1.3 comments to the Code, and capture errors in the code, why capture? What are the errors? Error classification? 8.1.4 comments the complete sentence or pseudocode and comments before writing the code.

The reason for not writing comments: it takes a lot of time to write comments (the customer is more difficult to understand = bad code) 8.1 programming principle 8.1.1 excellent comments, add information 8.1.3 comments to the Code, and capture errors in the code, why capture? What are the errors? Error classification? 8.1.4 comments the complete sentence or pseudocode and comments before writing the code.

Reasons for not writing comments:

Time elapsed

It is difficult to write comments (it is more difficult for customers to understand = bad code)

8.1 programming principles

8.1.1 excellent comments to add information to the code

8.1.3 Note: capture errors in the Code. Why? What are the errors? Error classification?

8.1.4 make comments before writing the code

Write comments or pseudocode for a complete sentence, and code between comments

8.1.5 solid color character comment line

8.1.8 readability of comments for reading (obscure comments = no comments at all)

Comments are text information.

Example

Use the complete statement (it is best not to divide it into paragraphs)

Avoid abbreviations

Capital the entire word to highlight the importance

8.1.9 comment indent, aligned with the code statement

8.1.10 each process should have a comment header, formatted

1.11 internal comments to describe the code process

(1) Add comments before each If statement

(2) Add comments before each Select Case statement

(3) add comments before each loop (For... Next and Do loop)

(4) add comments before each statement that modifies the global variables to facilitate debugging.

8.1.12 Line End comment, short description; internal comment, long description

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.