Miscellaneous (programming style) ---- Google Code style!

Source: Internet
Author: User
1. The file name must contain lowercase letters and underscores. The header file ends with. h, and the definition file ends with. CC. For example, my_useful_class.cc2. The type name starts with an uppercase letter. When multiple words are combined, the first letter of each word is capitalized. For example, urltableerrors.3. common variable name: A combination of lowercase letters and underscores. For example, table_name data member variable: A combination of lower-case letters and underscores, followed by an underscore. For example, table_name _ struct variable: similar to a common variable, you do not need to add an underscore at the end. Global variable: you can add a flag before the variable _. Example: g_error_num; 4. The constant name starts with K and the first letter of the word is capitalized. For example, kdaysinaweek.5. function name: a common function that starts with an uppercase letter and starts with an uppercase letter. GET/set function: name of the variable to be obtained or set, for example, num_error () const, set_num_error () 6. the namespace name is composed of lowercase letters based on the project name and directory structure. 7. The enumerated names use the constant naming rules. For example, Enum urltableerrors {Kok = 0, kerroroutofmemory} 8. Generally, you do not need to define macros for macro names. If you really need them, use uppercase letters and underscores. 9. If you define something similar to an existing C or C ++ entity, you can follow its previous style. For example, bigopen () open ()

Miscellaneous (programming style) ---- Google Code style!

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.