Windows client/C + + programming Specification "Recommendations"--style

Source: Internet
Author: User

This article from: http://blog.csdn.net/breaksoftware/article/details/37935459

The naming style is also well suited for C #

9 Style 9.1 Preferential use of Hungarian nomenclature

Rating:"recommended"
Description: This method is designed by the Microsoft Master Designer. Programming on Windows best complies with this standard. Detailed introduction See: http://zh.wikipedia.org/wiki/%E5%8C%88%E7%89%99%E5%88%A9%E5%91%BD%E5%90%8D%E6%B3%95

9.2 variable names combined with Hungarian nomenclature and hump naming method

Rating:"recommended"
Description: for example int nmaxcount = 1; the variable prefix n denotes int type variable, maxcount is ideographic, it is using the Hump naming method (capitalized).

9.3parentheses are separated by a space after the default keyword

Rating:"recommended"
Note: A space is added between the If/switch/while/for/catch and the parentheses behind it. This allows you to quickly distinguish between an API or a language keyword for the operation of parentheses.

9.4 Global variables use g as prefix

Rating:"recommended"
Description: Used to clearly differentiate the variable as a global variable.

9.5 Global static variables are prefixed with S_

Rating:"recommended"
Description: Used to clearly differentiate the variable as a global variable.

9.6class static members use the _S_ prefix

Rating:"recommended"
Description: Used to clearly distinguish whether the variable is a global variable or a class static member variable.

9.7 Global static variables are named as long and meaningful as possible

Rating:"recommended"
Note: This ensures that the same name does not appear.

9.8 Enumeration type members, using the all-uppercase serpentine nomenclature (snake_case)

Rating:"recommended"

Note: All letters are capitalized, and the words are separated by underscores. It is best to use e_ as a prefix

Serpentine nomenclature: All larger or all lowercase, with underscores separated between words.

Windows client/C + + programming Specification "Recommendations"--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.