Contracts, safety and correctness

Lucian Radu Teodorescu

⏱ 90 minute session
intermediate
advanced
14:30-16:00, Wednesday, 17th June 2026

Since 2023, safety has become a central theme in C++. In response to criticism of memory-unsafe languages, the C++ standard committee has intensified its efforts in this area. Over time, the term safety itself has become increasingly overloaded, with different stakeholders often meaning very different things by it. More recently, this ambiguity has led some to avoid the term safety altogether.

Contracts are one of the major features proposed for C++26. While they enjoy broad support, there is ongoing debate about their role: are contracts primarily about safety, correctness, or something else entirely, and what expectations should users place on them?

This talk aims to clarify the relationship between safety and correctness, and to position contracts within that landscape. We will discuss what contracts can and cannot guarantee, how they relate to different notions of safety, and how they can be used effectively to improve program correctness, illustrated with practical C++ examples. Finally, we take a step back and look beyond contracts at a small set of design and coding practices aimed at writing safer and more reliable C++ code.

Lucian Radu Teodorescu

Lucian Radu Teodorescu has a PhD in programming languages and is a Staff Engineer at Garmin. He likes challenges; and understanding the essence of things (if there is one) constitutes the biggest challenge of all.