REVIEW - Beautiful C++ - 30 Core Guidelines for Writing Clean, Safe, and Fast Code


Title:

Beautiful C++

30 Core Guidelines for Writing Clean, Safe, and Fast Code

Author:

J. Guy Davidson, Kate Gregory

Publisher:

Pearson Addison-Wesley (2021)

Pages:

352

Reviewer:

Ian Bruntlett

Reviewed:

March 2023

Rating:

★★★★★


Verdict: Highly Recommended

I am approaching this book as a not-an-expert C++ programmer who has plenty to learn. Reading this book was an interesting experience – there were things I was a little unsure of in terms of my understanding, things that I strongly agreed with and things that went by without further ado.

The C++ Core Guidelines ( https://github.com/isocpp/CppCoreGuidelines ) are a community effort led by Bjarne Stroustrup and Herb Sutter, with the intent “to help people to use modern C++ effectively”. Previously, this role has been fulfilled by Scott Meyer’s Effective books. In the context of this book, Modern C++ stretches from C++11 through to C++20. This book takes 30 of these core guidelines and examining them in detail, with one guideline per chapter. It is further split up into five sections, each containing 6 chapters:

  1. Bikeshedding is bad – stop wasting valuable time on trivia.
  2. Don’t hurt yourself (by writing code that will cause problems later).
  3. Stop using that (avoiding bad legacy features).
  4. Use this new thing properly (guidelines on language innovations).
  5. Write code well by default (writing statically type-safe, leak resistant and easier to maintain code).

Code from the book is available for experimentation using Compiler Explorer - https://godbolt.org/z/cg30-ch0.0 will take you to the main relevant page.

This book reads well, and isn’t too demanding on the reader’s time. It is a beautiful book. Read it.

Website: https://www.pearson.com/en-us/subject-catalog/p/beautiful-c-30-core-guidelines-for-writing-clean-safe-and-fast-code/P200000009446/9780137647842