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


Beautiful C++

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


J Guy Davidson, Kate Gregory


Addison-Wesley Professional (2021)




Anthony Williams


May 2022



Verdict: Highly Recommended

This book is subtitled 30 Core Guidelines for Writing Clean, Safe, and Fast Code, and covers 30 guidelines chosen from the ‘C++ Core Guidelines’ [1], with each chapter focusing on a single guideline.

If you’re not familiar with the ‘C++ Core Guidelines’, they are a rather extensive list of guidelines for writing C++ code, edited by Herb Sutter and Bjarne Stroustrup, with considerable contribution from the community – the Github page currently lists 294 contributors. The full list of guidelines covers every aspect of C++ development, and includes guidelines that range from the very general (such as ‘P.8 Don’t Leak Resources’) to the very specific (such as ‘Enum.5 Don’t use ALL_CAPS for enumerators’). The authors of this book have chosen 30 guidelines which they think are especially valuable, and written a detailed chapter on each of them.

Each chapter is an easy read, with discussion of the guideline itself, along with examples of the problems that can arise from not following the guideline, and how it can improve your code. There are also plenty of anecdotes from the authors’ careers. The chapters are standalone and self-contained, so can be read in any order, and are short enough that you could read a chapter in a single sitting, like you would a blog post or magazine article.

Another nice feature is that the authors have provided a set of examples which are available on Compiler Explorer [2].

I would strongly recommend that every C++ developer reads this book. If you’ve not previously thought about the issues covered, you might find that some of the guidelines covered improve your code. Even if you already follow all these guidelines, it’s an entertaining read, and the copious links to the other C++ Core Guidelines may lead to something you haven’t thought about. Plus, if you are ever mentoring other developers, then it gives you some clear examples and rationale to use when explaining how and why they should follow these guidelines.





Your Privacy

By clicking "Accept All Cookies" you agree ACCU can store cookies on your device and disclose information in accordance with our Privacy Policy and Cookie Policy.

By clicking "Share IP Address" you agree ACCU can forward your IP address to third-party sites to enhance the information presented on the site, and that these sites may store cookies on your device.