C++ Coding Standards: 101 Rules, Guidelines, and Best Practices
<p>Consistent, high-quality coding standards improve software quality, reduce time-to-market, promote teamwork, eliminate time wasted on inconsequential matters, and simplify maintenance. Now, two of the world's most respected C++ experts distill the rich collective experience of the global C++ community into a set of coding standards that every developer and development team can understand and use as a basis for their own coding standards. </p> <p>The authors cover virtually every facet of C++ programming: design and coding style, functions, operators, class design, inheritance, construction/destruction, copying, assignment, namespaces, modules, templates, genericity, exceptions, STL containers and algorithms, and more. Each standard is described concisely, with practical examples. From type definition to error handling, this book presents C++ best practices, including some that have only recently been identified and standardized-techniques you may not know even if you've used C++ for years. Along the way, you'll find answers to questions like </p> <ul> <li>What's worth standardizing--and what isn't? </li> </ul> <ul> <li>What are the best ways to code for scalability?</li> </ul> <ul> <li>What are the elements of a rational error handling policy? </li> </ul> <ul> <li>How (and why) do you avoid unnecessary initialization, cyclic, and definitional dependencies?</li> </ul> <ul> <li>When (and how) should you use static and dynamic polymorphism together?</li> </ul> <ul> <li>How do you practice "safe" overriding?</li> </ul> <ul> <li>When should you provide a no-fail swap? </li> </ul> <ul> <li>Why and how should you prevent exceptions from propagating across module boundaries?</li> </ul> <ul> <li>Why shouldn't you write namespace declarations or directives in a header file?</li> </ul> <ul> <li>Why should you use STL vector and string instead of arrays?</li> </ul> <ul> <li>How do you choose the right STL search or sort algorithm?</li> </ul> <ul> <li>What rules should you follow to ensure type-safe code?</li> </ul> <p>Whether you're working alone or with others, <i> <b>C++ Coding Standards</b> </i> will help you write cleaner code--and write it faster, with fewer hassles and less frustration.</p> <br> <br>