Editorial Reviews. From the Back Cover. Consistent, high-quality coding standards improve Guidelines, and Best Practices (C++ In-Depth Series) eBook: Andrei Alexandrescu, Herb Sutter: Kindle Store. Covers coding standards for C++. C++ Coding Standards: Rules, Guidelines, and Best Practices. Herb Sutter. Andrei Alexandrescu. © |Addison-Wesley Professional | Available. Consistent, high-quality coding standards improve software quality, reduce time- to-market, promote teamwork, eliminate by Andrei Alexandrescu, Herb Sutter.
|Country:||Papua New Guinea|
|Published (Last):||3 January 2011|
|PDF File Size:||11.67 Mb|
|ePub File Size:||12.36 Mb|
|Price:||Free* [*Free Regsitration Required]|
Consider making virtual functions nonpublic, and public functions nonvirtual. Consider overloading to avoid implicit type conversions. Prefer initialization to assignment in constructors Class Design and Inheritance.
Get unlimited access to videos, live online training, learning paths, books, tutorials, and more. Report, handle, and translate errors appropriately. Class Design and Inheritance. Establish a rational error handling policy, and apexandrescu it strictly Copy and destroy consistently.
The organization is clear and intuitive, the topics are pertinent, and the content is of the highest quality. Customize intentionally and explicitly But beware the trap of being too quick to think: Avoid allocating and deallocating memory in different modules. Don’t use C-style casts. Why should you use STL vector and string instead of arrays? Organizational and Policy Issues.
Don’t use unsafe functions. Consider overloading to avoid implicit type conversions. View table of contents.
When and how should you use static and dynamic polymorphism together? Avoid type switching; prefer polymorphism Use a version control system 4.
C++ Coding Standards: 101 Rules, Guidelines, and Best Practices
Define and initialize member variables in the same order. Prefer calling the prefix forms. Use the accepted idioms to really shrink capacity and really erase elements STL: Prefer providing abstract interfaces.
Be clear what kind of class you’re writing. If you provide any class-specific new, provide all of the standard forms plain, in-place, and nothrow. How do you practice “safe” overriding? Use vector and string instead of arrays View current errata list View the Bibliography Order via Amazon.
Avoid magic numbers Avoid casting away const Destructors, deallocation, and swap never fail Don’t treat arrays polymorphically.
Don’t allow codnig to propagate across module boundaries. Use the right STL sort algorithm Why and how should you prevent exceptions from propagating across module boundaries? Use vector by default.
C++ Coding Standards – Book Home Page
An extended explanation of the guideline. Whenever it makes sense, provide a no-fail swap and provide it correctly. Avoid providing implicit conversions. Customize intentionally and explicitly. Never write external include guards Functions and Operators When should you provide a no-fail swap?
Prefer function objects over functions as algorithm and comparer arguments Declare variables as locally as possible. Compile cleanly at high warning levels 2. Why should you use STL vector and string instead of arrays?
Sutter & Alexandrescu, C++ Coding Standards: Rules, Guidelines, and Best Practices | Pearson
Assert liberally to document internal assumptions and invariants. Use the right STL search algorithm. Coding standards have many advantages: