~/talk

Writing C++ to Be Read

Talkat CppNorth 2023 · 2023-07-17..07-19· [software-architecture]
links:none on file
slides:none on file

Argues for concrete practices: prefer the rule of zero and aggregates so the compiler generates constructors/comparisons (use defaulted spaceship) and you write less buggy boilerplate; use designated initializers for clear option structs; replace sentinel values and out-params with std::optional; pass sequences with std::span instead of pointer+size; transfer ownership with unique_ptr, share with shared_ptr; avoid ambiguous bool parameters and prefer named enums; document team naming and parameter conventions for faster onboarding.

AI-written summary · about

  1. 0:00Introduction and motivation
  2. 6:09Code review mindset
  3. 9:23Avoid clever code
  4. 15:49Letting compiler write code
  5. 22:57Aggregates and initialization
  6. 29:03Returning multiple values
  7. 32:14Keep it simple
  8. 34:21Function intent and parameters
  9. 39:00Invalid values and optionals
  10. 44:40Booleans and enums
  11. 46:48Passing arrays with span
  12. 49:57Smart pointers and ownership
  13. 51:41Summary and conclusion
~/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.