More effective C ++: 35 effective methods to improve programming and design (Chinese Version)

Source: Internet
Author: User

More effective C ++: 35 effective methods to improve programming and designChinese version) China-Pub computer New Book recommendation

Basic Information
Original Title: more effective C ++: 35 new ways to improve your programs and designs
Original Press: Addison-Wesley professional
Author: (US) Scott Meyers
Translator: Hou Jie
Series name: Classic Books
Press: Electronic Industry Press
ISBN: 9787121125706

Introduction
Scott Meyers launched this "sequent" in 1996 following Objective C ++ ". When the number of terms is relatively small, the number of pages is a little higher, because the selection is higher than that of the "first set", especially chapter 5th. Meyers named this chapter techniques and clearly tells you that there are some patterns, such as virtual constructors, smart pointers, reference counting, proxy classes, double dispatching ...... Each clause in this chapter is 15 ~ As many as 30 pages, there is a sigh of relief from the treasure of mountains and waters.
Although the publication was a little older, the book was not in version 2nd, because when it was published (1996), c ++ standard was almost finalized, this book was written according to the standard draft at that time. It is almost the same as today's c ++ Standard Specification. In addition, Meyers also provides some notes about the elasticity that may change. You can log on to the website provided by the author to see the errata and discussion in the previous two sets (the quantity is large, which is frightening. Fortunately, there are no major mistakes due to technical discussions or textual discretion ).

Directory
Translated by Hou Jie)
Introduction)
Basics)
Clause 1: differentiate pointers and references
Distinguish between pointers and references.
Clause 2: it is best to use the C ++ transformation operator
Prefer C ++-style casts.
Clause 3: Never process arrays in a polymorphically way.
Never treat arrays polymorphically.
Clause 4: it is not necessary to provide default constructor
Avoid gratuitous Default constructors.
Operators)
Article 5: Be alert to the customized "type conversion function"
Be wary of user-defined conversion functions.
Clause 6: differentiate between increment and Decrement Operators
Prefix and Postfix
Distinguish between prefix and Postfix forms of Increment
And decrement operators.
Clause 7: Never reload &, and operators
Never overload &, or ,.

. Clause 8: understand new and delete with different meanings
Understand the different meanings of new and delete
Exceptions)
Clause 9: Use Destructors to avoid resource leakage
Use Destructors to prevent resource leaks.
Clause 10: prevent resource leakage in Constructors)
Prevent resource leaks in constructors.
Clause 11: disallow exceptions to flow out of Destructors
Prevent exceptions from leaving Destructors.
Clause 12: Understand "throwing an exception" and "passing a parameter"
Or the difference between "calling a virtual function"
Understand how throwing an exception differs from
Passing a parameter or calling a virtual function.
Clause 13: capture exceptions by reference
Catch exceptions by reference.
Clause 14: use exception specifications wisely
Use exception specifications judiciously.
Clause 15: understand the cost of Exception Handling
Understand the costs of exception handling.
Efficiency)
Clause 16: Keep in mind the 80-20 rule
Remember the 80-20 rule.
Clause 17: Consideration of lazy Evaluation)
Consider using lazy evaluation.
Clause 18: amortize the expected computing costs
Amortize the cost of expected computations.
Clause 19: Understanding the source of the temporary object
Understand the origin of temporary objects.
Article 20: assist in "Return Value optimization (RVO )"
Facilitate the return value optimization.
Article 21: using overload technology to avoid implict type conversions)
Overload to avoid implicit type conversions.
Cla22: consider replacing its exclusive form (OP) with operator composite form (OP =)
Consider using op = instead of stand-alone op.
Cla23: Consider using other libraries
Consider alternative libraries.
Clause 24: Understand virtual functions, multiple inheritance, virtual base classes,
Runtime type identification cost
Understand the costs of virtual functions, multiple inheritance,
Virtual base classes, and rtti.
Technology (techniques, idioms, patterns)
Clause 25: Virtualize constructor and non-member functions
Virtualizing constructors and non-member functions.
Clause 26: Limit the number of objects a class can produce
Limiting the number of objects of a class.
Article 27: require (or forbid) the object to be generated in heap
Requiring or prohibiting heap-based objects.
Article 28: Smart pointers)
Clause 29: reference counting)
Clause 30: proxy classes (proxy and proxy)
Cla31: Let the function decide how to virtualize based on more than one object type
Making functions virtual with respect to more than one object.
Miscellaneous discussion (miscellany)
Cla32: Develop procedures in the future tense
Program in the future tense.
Cla33: Design non-tail class (non-leaf classes)
Abstract class)
Make non-leaf classes abstract.
Cla34: how to combine C ++ and C in the same program
Understand how to combine C ++ and C in the same program.
Article 35: Get yourself used to Standard C ++ Language
Familiarize yourself with the language standard.
Recommended books
Auto_ptr implementation code
Index (1) (General Index)
Index (2) (index of example classes, functions, and templtes)

Book details and purchase address:Http://www.china-pub.com/197665

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.