~/talk

Exceptionally Bad: The Misuse of Exceptions in C++ & How to Do Better

Talkat CppCon 2023 · on Tuesday, 2023-10-03· at 09:00· Adams, 6700 North Gaylord Rockies Boulevard· [security]
links:none on file
slides:none on file

Claims that C++ exceptions get misused in resource management, retries, hierarchies, data passing and control flow and that fixing them needs concrete patterns not platitudes. Demonstrates actual replacements: RAII over catch handlers for cleanup, return expected/optional for shallow returns instead of loop-retries, a simple single templated exception class (Omega) with mutable logging in exception objects plus source_location and stack traces. Shows these tools reduce class explosion, make logs actionable, and keeps exceptions for rare, serious, transactional or deep-unwind cases.

AI-written summary · about

  1. 0:00Introduction
  2. 2:12What this talk will cover
  3. 3:18C++ exception misconceptions
  4. 10:38How exceptions work
  5. 16:34Exception safety guarantees
  6. 17:59Exception philosophy
  7. 25:02Real-world misuse
  8. 25:24Resource management patterns
  9. 27:33Retry mechanisms
  10. 30:01Pass-the-buck anti-pattern
  11. 33:30Logging and context passing
  12. 37:04Error detection alternatives
  13. 39:34Data passing to handlers
  14. 41:42Exception class pitfalls
  15. 43:30Control flow patterns
  16. 46:20Exception hierarchy flaws
  17. 53:24Simplifying with base classes
  18. 53:45Stack unwinding scenarios
  19. 55:50Truly exceptional use cases
  20. 56:11Omega exception class
  21. 59:46Proper exception use
  22. 1:00:10Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.