How to Build Cpp Interfaces That Are Hard to Use Incorrectly - Andreas Weis - C++ on Sea 2023
---
How to Build Cpp Interfaces That Are Hard to Use Incorrectly - Andreas Weis - C on Sea 2023
C is a language with many sharp edges. Besides the core language providing plenty of features that allow users to shoot themselves in the foot, higher-level library interfaces are also often designed with complex preconditions, the violation of which can again lead to undefined behavior and results that are just as unpredictable as what results from misuse of a lower level language feature. Fortunately, through clever use of the C type system we can design interfaces in a way that makes them much harder to misuse accidentally and drastically reduce the opportunities for bugs in user code.
In this talk, we will present a number of design techniques that allow library designers to reduce the possibilities of misuse by their users, by pushing the detection of precondition violations from run-time to compile-time. We will show how to distinguish different categories of preconditions and how we can use the C type system to prevent accidental violation of those preconditions at runt-time. We will demonstrate with a number of code samples how the use of such type-based techniques prevents interface misuse in practice and take a look at the trade-offs that arise from such an approach.
---
Slides:
Sponsored by think-cell:
---
Andreas Weis
Andreas Weis has been writing C code in many different domains, from real-time graphics, to distributed applications, to embedded systems. As a library writer by nature, he enjoys writing portable code and exposing complex functionalities through simple, richly-typed interfaces. Both of which C allows him to do extensively. Andreas is also one of the co-organizers of the Munich C User Group, which allows him to share this passion with others on a regular basis.
He currently works for Woven Planet, where he focuses on building modern software for use in safety critical systems.
---
C on Sea is an annual C and coding conference, in Folkestone, in the UK.
- Annual C on Sea, C conference:
- 2023 Program:
- Twitter:
---
YouTube Videos Filmed, Edited & Optimised by Digital Medium:
#cpp #cpponsea #interfaces
1 view
166
40
5 months ago 00:00:41 1
Coke and Mentos Slicing Prank Gone WRONG!
5 months ago 00:04:12 1
In Hearts Wake - Farewell (video 2024)
5 months ago 00:46:46 1
FOUND MURDER WEAPON after being CONFRONTED by ANGRY NEIGHBOR
5 months ago 00:10:33 1
Принимайте в мае! Средство для здоровья и молодости! Укрепить здоровье и омолодить кожу!
5 months ago 00:05:13 1
Lighthouse Family - High (Official Music Video)
5 months ago 00:03:50 1
AD INFINITUM - Upside Down (Official Video) | Napalm Records
5 months ago 00:00:59 1
Шикарный Весенний Стиль 50+
5 months ago 00:09:44 1
Easy Silk Screening for Pottery - BEST WAY TO SILK SCREEN POTTERY!
5 months ago 01:16:00 1
AI Manifest: The Most Beautiful Space Visualization on the Internet | 4K UHD | 24 FPS
5 months ago 00:03:39 1
Genshin Impact Animation – ONE MORE PULL (Music Video) ■ feat. Black Gryph0n & Rustage
5 months ago 01:51:55 1
1945-1953 From World War to Cold War
5 months ago 00:10:56 1
Cartoon Character Design USING ONLY YOUR MOUSE : Adobe illustrator Tutorial Speed Art 2021.
5 months ago 00:05:31 1
Урок 9. Writing a formal letter. Английский язык 11 класс
5 months ago 00:11:43 1
Secret Chemtrail Pilot Speaks, on Dec 8, 2014
5 months ago 00:00:16 1
Assassins creed mask Steel Soul music tiktok trend
5 months ago 00:04:48 1
How to FIX Desyncs in 5 Minutes
5 months ago 00:01:06 1
Changing ISO Files to use B Raw in resolve 18
5 months ago 00:00:16 1
I and trend mask Triple Death music tiktok
5 months ago 00:06:18 1
OMNIMAR - Forever (Official Video) | darkTunes Music Group
5 months ago 00:04:02 1
How to use can and can’t | English for kids with Novakid
5 months ago 00:06:15 1
After effects “SMOOTH TEXT ANIMATION“
5 months ago 00:04:46 1
Slipknot - Unsainted [OFFICIAL VIDEO]
5 months ago 00:57:00 1
Simon Keye | All The Way Visual March 2024 at Sea Casino | Burgas (Bulgaria)
5 months ago 00:00:00 1
4/4 PORTAL • APRIL 2024 • MANIFEST YOUR DREAMS • MIRACLE FREQUENCY • 528Hz