C++ Core Guidelines - Modernize your C++ Code Base

By Peter Sommerlad

Leading C++ experts propose the C++ Core Guidelines to foster better coding practices for C++ developers. The Core Guidelines build around safe coding practices without losing C++'s efficiency, such as using const deliberately or minimize the use of raw pointers. Many of the guidelines provide hints for enforcing the guideline and some even require or imply effective static analysis tooling to make them useful.

IFS (Institute for Software) has a long history of providing static analysis within an IDE and also suggesting transformation for improving code, such as, applying C++11’s initializers, instead of uninitialized or old-fashioned initialized variable declarations. While already addressing some areas covered by the Core Guidelines, we recently targeted many more of those explicitly and provide corresponding static analysis and quick-fix refactoring support to adjust existing C++ code toward following the core guidelines.

This talk will introduce the C++ Core Guidelines and demonstrate how you can modernize your code and improve its quality without losing performance through automated tooling built into Cevelop.

Topics covered:

  • What are the C++ Core Guidelines

    • Philosophy and goals

    • Areas covered

    • Examples

  • Automatic "repair" of code

    • const Correctness

    • Constructors/destructors/assignment

    • Pointers and arrays

  • Future work/Outlook

The audience will get an overview of the C++ Core Guidelines. Using practical code examples improvements through application of the guidelines is demonstrated. Tools will be shown, that aid in detection of guideline violation and automatic repair to guideline-conforming code. Attending developers will be enabled to apply the Core Guidelines in the future to create or refactor to safer and more maintainable C++ code.