REVIEW - C++ Core Guidelines Explained - Best Practices for Modern C++


C++ Core Guidelines Explained

Best Practices for Modern C++


Rainer Grimm


Addison-Wesley Professional (2022)




Alan R. Griffiths


March 2023



Verdict: Recommended

Over my career I’ve accumulated a collection of coding guidelines (and standards) from various sources. The point of such guidelines is to improve the quality of code written according to them over the status quo. Some guidelines focus on avoiding constructs supported by the language that the authors consider hard or impossible to use correctly and suggest better alternatives, some guidelines are focussed on conforming to the idioms adopted by the authors.

With C++ the constructs supported by the language have been evolving rapidly over the last decade with better options frequently replacing what was formerly idiomatic code. Of course, the code written ten or more years ago is still valid code, but there needs to be guidance to programmers that they should no longer write it that way.

The C++ Core Guidelines is an effort by some prominent members of the C++ standards committee: Bjarne Stroustrup and Herb Sutter are names I expect all readers of C Vu to recognise. They are not the only contributors (there are 310 according to github) but they are the “editors”. I’m sure that many of the other names involved will also be familiar. Who could be better placed to understand the changes happening in the C++ language and what they mean for the way code ought to be written.

So what does Rainer Grimm’s book add by way of explanation? Well, the guidelines themselves are unchanged from the C++ Core Guidelines original. But instead of a somewhat terse style of ‘Reason....Example...Note...’ there is a fluent discussion of the motivation and practice of each of the guidelines. This makes for a much more accessible presentation of the core material.

If you’ve not updated the way you write C++ for a few years, or if you are just beginning to develop your coding skills, I can recommend this as a good reference for the current best practice.


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.