In-depth "Analysis of C++ Core Guidelines": A key guide to improving C++ programming practice

Insert image description here


1. Write in front

Insert image description here

C++ Core Guidelinesis an ongoing open source project that solves these problems by bringing together widely recognized best practices in modern C++ in one place. Core GuidelinesRely on decades of experience and early coding rules. They share a conceptual framework with C++ itself, focusing on type safety, resource safety, and the elimination of avoidable complexity and inefficiency. The main purpose of initiating the Core Guidelines was to address known problem areas while enabling static analyzer enforcement. In "Analysis of C++ Core Guidelines", C++ expert lecturer Rainer Grimm distills the essence of the Core Guidelines, removes obscure content, shares new insights and background, and provides fully tested examples from his own training courses. .

2. Reasons for recommendation

  1. I have always believed that learning a language should not just stop at the syntax level, but should have an in-depth understanding of the framework and some ideas. The Core Guidelines focus on some relatively high-level issues, such as interfaces, resource management, memory management, and concurrency, which can help us improve our thinking. Highly, learn the effective architectural design ideas and concepts in the industry, so it is necessary to read this book
  2. Easy to understand, with detailed cases : This book provides a wealth of code examples and analysis to help readers better understand the application of each guiding principle in actual coding. The examples cover everything from coding style to memory management, concurrent programming, and more
  3. The C++ Core Guide is organized as a reference book. It is not a tutorial, and it is not convenient to learn how to use modern C++ by reading it from beginning to end. However, this book provides a detailed interpretation of the C++ Core Guidelines, covering the main content and guiding principles of each chapter. Readers can fully understand the core ideas and practical points of the C++ Core Guidelines.

3. Introduction

This book has 20 chapters in total

  • Chapter 1 - Introduction: Introduces the target audience, purpose, non-purpose, structure and main parts of the book.
  • Chapter 2 - Philosophy: Discusses the philosophy of C++ programming guidelines and why they should be followed.
  • Chapter 3 - Interface: Focuses on the importance of building a good interface, including avoiding the use of non-const global variables, dependency injection applications, interface design, etc.
  • Chapter 4 - Functions: Covers the rules for function definition, best practices for parameter passing, return value semantics and other aspects.
  • Chapter 5 - Classes and Class Hierarchies: Describes how to design good classes and class hierarchies, including constructors, assignment operators, destructors, overloading, and operator overloading.
  • Chapter 6 - Enumerations: Discusses the use of enumeration types and related rules.
  • Chapter 7 - Resource Management: Emphasizes the rules of memory allocation and release, including the use of smart pointers.
  • Chapter 8 —Expressions and Statements: Covers best practices for declarations, expressions, statements, and arithmetic.
  • Chapter 9 —Performance: Discusses common performance optimization mistakes and how to do them correctly.
  • Chapter 10 —Concurrency: Introduces the basic concepts of concurrency and parallel programming, and discusses techniques such as message passing and lock-free programming.
  • Chapter 11 - Error Handling: Discusses best practices for designing and implementing error handling mechanisms, including exception handling and error handling rules.
  • Chapter 12 —Constant and Immutability: explains the rules and best practices for using const and constexpr.
  • Chapter 13 - Templates and Generic Programming: Covers the rules and techniques related to templates and generic programming.
  • Chapter 14 —C-Style Programming: Discusses best practices when using C-style programming.
  • Chapter 15 - Source Files: Discusses the rules for handling interfaces and implementation files and namespaces.
  • Chapter 16 - Standard Library: Discusses the best practices for containers, text, input and output, etc. in the C++ standard library.
  • Chapter 17 - Architectural Concepts: Introduces some ways of thinking and principles about architectural design.
  • Chapter 18 - False Rules and Misunderstandings: Clarifies some common misunderstandings and false rules.
  • Chapter 19 - Specification Configuration: Discusses the use of Pro.type, Pro.bounds, Pro.lifetime and other specification configurations.
  • Chapter 20 —Guidelines Support Library: Introduces some views, ownership pointers, assertions, and utilities in the Guidelines support library.

The appendix includes implementation of C++ Core Guidelines, concepts, and contracts.

4. Introduction of the author

Rainer GrimmWorked as a software architect, team leader and coach since 1999 and has been conducting training courses in C++, Python and proprietary software since 2002. As an independent training instructor, he speaks at programming conferences, blogs weekly in English and German, and has written several books on modern C++ and concurrency.

The translators are Wu Yongwei, He Ronghua, Zhang Yunchao and Yang Wenbo.

5. Book donation or purchase

Purchase link: "Analysis of C++ Core Guidelines"

Book purchase portal: https://u.jd.com/v8zuKlc
Jingdong coupon collection address (no threshold coupon 10 yuan):
APP: https://pro.m.jd.com/mall/active/2Z3HoZGKy5i9aEpmoTUZnmcoAhHg/index. html
PC: https://pro.jd.com/mall/active/2Z3HoZGKy5i9aEpmoTUZnmcoAhHg/index.html

How to participate in the book donation event?

点击文章底部微信名片,参与朋友圈赠书活动,点赞8,18,28各送一本,包邮到家!!!

Guess you like

Origin blog.csdn.net/qq_72157449/article/details/132804687