15–18 Sept 2015
Hotel Schweizerhof, Saas-Fee
Europe/Zurich timezone

Writing good C++14

16 Sept 2015, 09:00
1h 30m
Hotel Schweizerhof, Saas-Fee

Hotel Schweizerhof, Saas-Fee

Haltenstrasse 10 Saas-Fee

Speaker

Bjarne Stroustrup (Morgan Stanley)

Description

How do we write C++ code that takes advantage of C++14 so that our code is better, rather than just different? How do we do so on a grand scale, rather than just for exceptional programmers? We need guidelines to help us progress from older styles, such as “C with Classes”, C, “pure OO”, etc. They need to be articulated rules to save us from each having to discover them for ourselves. Ideally, they should be machine-checkable, yet adjustable to serve specific needs. In this talk, I describe a set of core guidelines developed to help most C++ programmers. This core can be augmented with rules for specific application domains such as embedded systems and systems with stringent security requirements. I do not believe that there could be a single set of rules that could serve everybody well, but there is a core set of useful and important rules that applies to most C++ use. These rules are prescriptive rather than merely restrictive, and about much more than formatting. I describe what the rules currently cover (e.g., interfaces, functions, resource management, pointers, and concurrency) and show a few examples. I describe some tools and a few simple useful classes that can be used to support the guidelines. The core guidelines and a checker tool reference implementation will be open source projects freely available on all major platforms.

Primary author

Bjarne Stroustrup (Morgan Stanley)

Presentation materials