~/talk

Easy to use, hard to misuse: Practical guidelines to tame your API

Talkat Core C++ 2023 · 2023-06-05..06-07· [software-architecture, c-and-cpp]
links:none on file
slides:none on file

Argues that strong types help but are not a silver bullet and shows concrete alternatives: named constructors, tagging enums and nested builder classes used to disambiguate Date/Point construction; gives a rule of thumb to introduce wrapper types only if many real classes use them. Classifies misuse by detectability (compile, immediate crash, prototype, docs) and demos a transaction-handle RAII trick and why a single set_date is safer than multiple setters. Covers error reporting (exceptions vs two‑phase vs expected/flag) and using no_discard wrapper for safer APIs; insists names reflect altitude in the call stack with real bug examples (failed_connect_count logic, extra_configuration doing too much).

AI-written summary · about

  1. 0:00Introduction to API design
  2. 1:04Problem with implicit assumptions
  3. 3:53When strong types help or hurt
  4. 5:41Classifying API misuse difficulty
  5. 7:25Worst case: relying on comments
  6. 10:34Designing safer APIs
  7. 12:44Common way should be safe way
  8. 15:16Handling bad dates
  9. 18:52Flag-based initialization pitfalls
  10. 23:31Importance of naming in APIs
  11. 26:18Naming functions by context
  12. 30:51Real-world API misuse examples
  13. 32:16Summary and final thoughts
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.