[GitHub Project] C + + Core guidelines

Source: Internet
Author: User

C + +, as a multi-paradigm language, has the flexibility. Plus some of the skills of C + +, some pits, many companies have their own C + + coding specifications. These specifications are generally recommended what to use, what should not be used, how to name and so on. There is no sketchy to give a complete rule system. Now, with some progress, Bjarne Stroustrup and Herb Sutter Two great gods, on GitHub, launched a project called C + + core guidelines. Project Address: Https://github.com/isocpp/CppCoreGuidelines

The C + + core guidelines are designed to help you use modern modern C + + efficiently. Here modern C + + is not the modern C + + Design book, but refers to c++11 and c++14 (including the immediate arrival of C++17). C++1X represents the rapid development of C + + in the new era, many of the characteristics of other languages have made C + + has a great change. These new features have yet to be validated by the engineering department.

C + + Core guidelines the use of C + + rules is divided into two levels: high level and low level. The advanced level involves interfaces, resource management, concurrency, and so on, and the rules at the advanced level affect the structure of the application and the design of the library. Following the rules at the advanced level, you can keep your code static type safe, without resource leaks, and avoid logic errors in most encodings. The rules at the senior level are for people. Low-level rules are described as coding details, such as naming rules, guaranteed initialization, which are mainly for tools, and the static Check analysis tool can detect whether the code violates the low-level rules. The C + + core guidelines focus on the high-level rules.

The C + + Core guide includes the following:

    • P:philosophy

    • I:interfaces

    • F:functions

    • C:classes and class hierarchies

    • Enum:enumerations

    • Es:expressions and statements

    • E:error Handling

    • R:resource Management

    • T:templates and generic programming

    • Cp:concurrency

    • Sl:the Standard Library

    • Sf:source files

    • Cpl:c-style programming

    • Pro:profiles

    • Gsl:guideline Support Library

    • Faq:answers to frequently asked questions

The design philosophy mentioned in the C + + Core guide:

  • P.1:express ideas directly in code

  • P.2:write in ISO standard C + +

  • P.3:express Intent

  • P.4:ideally, a program should is statically type safe

  • P.5:prefer compile-time checking to run-time checking

  • P.6:what cannot be checked at compile time should being checkable at run time

  • P.7:catch Run-time Errors Early

  • P.8:don ' t leak any resource

  • P.9:don ' t waste time or space

Interested can go to read, it is best to have someone can translate into Chinese to share to everyone.


[GitHub Project] C + + Core guidelines

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.