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


Title:

C++ Core Guidelines Explained

Best Practices for Modern C++

Author:

Rainer Grimm

Publisher:

Addison-Wesley Professional (2022)

Pages:

464

Reviewer:

Alan R. Griffiths

Reviewed:

March 2023

Rating:

★★★★☆


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.

Website: https://www.informit.com/store/c-plus-plus-core-guidelines-explained-best-practices-9780136875673






Your Privacy

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

Current Setting: Non-Essential Cookies REJECTED


By clicking "Include Third Party Content" you agree ACCU can forward your IP address to third-party sites (such as YouTube) to enhance the information presented on this site, and that third-party sites may store cookies on your device.

Current Setting: Third Party Content EXCLUDED



Settings can be changed at any time from the Cookie Policy page.