~/talk

Easy to Use, Hard to Misuse: Declarative Style in C++

slides:none on file

Argues that fewer statements and more expressions make C++ code easier to reason about, showing concrete rewrites: replace assignment-in-conditions with if-initializer, use an immediately-invoked lambda or optional-like monadic access for weak_ptr locking, and prefer RAII and std helpers (std::exchange, apply, no_discard) to catch misuse. Demoed a reusable schedule/backoff builder used in real projects, a logging “sync” interface returning bool, and a template bitmask type-state trick that enforces required fields at compile time; found zero chained-assignment uses in a 100k+ line codebase.

AI-written summary · about

  1. 0:00Intro
  2. 0:19Overview
  3. 1:48Indicators of declarative style
  4. 6:54History of assignment
  5. 13:50Declarative style example
  6. 16:20Not an expression statement
  7. 19:02What can we say
  8. 19:53Core guidelines
  9. 21:00Other things
  10. 23:59Algorithms
  11. 25:32ObjectOriented Style
  12. 28:07Log Sync
  13. 31:48Declarative Style
  14. 32:51Compositional Patterns
  15. 33:11ObjectOriented Patterns
  16. 34:19Builder Pattern
  17. 35:20Builder Pattern Example
  18. 39:55Send Request Example
  19. 40:38Fluent Style
  20. 42:05Functions Lambdas
  21. 42:39Overloads
  22. 45:01operator overloading
  23. 45:33imperative safety gear
  24. 46:00no discard
  25. 48:17identity
  26. 49:00guidelines
  27. 51:48conditional replacement metapattern
  28. 53:30goal of replacing
  29. 54:07point of use
  30. 54:37safety gear
  31. 55:06clarity of interfaces
  32. 56:12goals for clarity
  33. 57:04passing fields in constructor
  34. 58:01identifying monoids
~/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.