C++ Best Practices (Full Color Syntax Highlighting): 45ish Simple Rules with Specific Action Items for Better C++
- Length: 153 pages
- Edition: 1
- Language: English
- Publisher: Independently published
- Publication Date: 2021-01-11
- ISBN-10: B08SGYGYS7
- ISBN-13: 9798589725469
- Sales Rank: #357972 (See Top 100 Books)
Level up your C++, get the tools working for you, eliminate common problems, and move on to more exciting things! This version is printed with full color syntax highlighted examples. A black and white only edition is available for less.As a C++ developer and trainer for 20 years, I have learned that there are many common mistakes that C++ developers of all experience levels make. This book distills that experience down into the most important things to address to make your code faster, easier to maintain, and more portable.Most sections have one or more exercises that help you apply what is discussed in a practical way in the code you are currently working onThis book is intentionally concise! Expect short sections for each item! I use as few words as possible to get across the point and get you applying what you learned to your code.If you follow me and watch all of my talks this book will present little new information to you. Why should you buy it then? Because I’ve consolidated the most important items and given you exercises to apply the rules in your code.
Title Page Table of Contents 1 Introduction 2 About Best Practices 3 Use the Tools: Automated Tests 4 Use the Tools: Continuous Builds 5 Use the Tools: Compiler Warnings 6 Use the Tools: Static Analysis 7 Use the Tools: Sanitizers 8 Slow Down 9 Learn Another Language 10 const Everything That’s Not constexpr 11 constexpr Everything Known at Compile Time 12 Prefer auto in Many Cases. 13 Prefer ranged-for Loop Syntax Over Old Loops 14 Use auto in ranged for loops 15 Prefer Algorithms Over Loops 16 Don’t Be Afraid of Templates 17 Don’t Copy and Paste Code 18 Follow the Rule of 0 19 If You Must Do Manual Resource Management, Follow the Rule of 5 20 Don’t Invoke Undefined Behavior 21 Never Test for this To Be nullptr, It’s UB 22 Never Test for A Reference To Be nullptr, It’s UB 23 Avoid default In switch Statements 24 Prefer Scoped enums 25 Prefer if constexpr over SFINAE 26 Constrain Your Template Parameters With Concepts (C++20) 27 De-template-ize Your Generic Code 28 Use Lippincott Functions 29 Be Afraid of Global State 30 Make your interfaces hard to use wrong. 31 Consider If Using the API Wrong Invokes Undefined Behavior 32 Use [[nodiscard]] Liberally 33 Use Stronger Types 34 Don’t return raw pointers 35 Prefer Stack Over Heap 36 No More new! 37 Know Your Containers 38 Avoid std::bind and std::function 39 Skip C++11 40 Don’t Use initializer_list For Non-Trivial Types 41 Use the Tools: Build Generators 42 Use the Tools: Package Managers 43 Improving Build Time 44 Use the Tools: Multiple Compilers 45 Fuzzing and Mutating 46 Continue Your C++ Education 47 Always Initialize Your Values 48 Prefer Spaceships (C++20) 49 Understand consteval and constinit (C++20) 50 Be Aware of Custom Allocation And PMR 51 Consider Designated Initializers (C++20) 52 Thank You 53 Bonus: Understand The Lambda
Donate to keep this site alive
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.