C23 for uninitiated—modern C idioms for expressive, safe, and performant code

Dawid Zalewski

⏱ 90 minute session
beginner
intermediate
14:00-15:30, Tuesday, 1st April 2025
There has been a revolution and you should know about it. It doesn't matter whether you are a C veteran or someone who last touched C while taking an undergrad course. C23 is here, and it has brought a thunderstorm of features to the language.

Some of them, like the mandatory variably-modified types or the reinterpretation of the auto keyword have made it more expressive. Others, like attributes, or macro improvements are great for library writers. There are also additions that make the language safer; among them, checked integer arithmetic macros, better const-propagating functions, and a strong type for NULL. But the most significant changes are those that we will all use: proper constants with constexpr, generic function-like macros with _Generic, well-behaved enums, the ability to #embed binary files directly in the source code, or to initialize objects with {}.

This session aims to be a tour de force of C23. We will dissect the new features and discuss how they affect the expressiveness and readability of code, improve compile- and run-time safety, or help compilers achieve better performance. While doing so, we will update old program fragments to use the new idioms and show how the new features interact with each other. We will also look at the current state of support for C23 in mainstream compilers and talk about how you can start using the new features today.

🏷 C23
🏷 preprocessor

Dawid Zalewski

Dawid is a computer engineer and a passionate teacher with over 25 years of programming experience. He has co-evolved with various languages including Basic, Turbo Pascal and 8051 assembly to finally settle in the land of C++ (with occasional visits to Python, C# and a few others). He teaches at a university of applied sciences in the Netherlands, where he tries to convert new generations of programmers to use modern C++. His professional interests focus on the design and evolution of programming languages and paradigms. In his spare time he reads, hikes, climbs or plays retro games.