"Writing High-quality code: 150 recommendations for improving C + + programs"

Source: Internet
Author: User
There is nothing new in this book, most of it is excerpts from effective C + + or other books, and the following are some of the things I might overlook when I'm programming. 1. Structure body variable layout: From small to large declaration by type size. 2. Introduce a large amount of C code in C + + code, and note whether to add extern "C". (C + + overloads, function names are flagged) 3. Manage the new object with a smart pointer. 4. Initialize with the member initialization list. 5. If you do not copy such functions, privatize it. 6. The Declaration and definition of the template are placed in the header file. 7. Reduce the number of function parameters as much as possible, because increasing the number of parameters increases the number of times the function is in the stack (multiple parameters can be encapsulated in a class). 8. Always be careful when programming, but optimize your code to the end.

"Writing High-quality code: 150 recommendations for improving C + + programs"

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.