~/talk

Retiring the Singleton Pattern, Concrete Suggestions for What to Use Instead

links:none on file
slides:none on file

Replaces global singletons with an explicitly passed com wrapper that defaults to a lazy-initialized static to keep source and ABI compatibility, enabling dependency injection so previously-opaque functions become unit-testable; uses std::function / std::ref to avoid copies of non-copyable internals and a one-time init pattern (function-local statics or compiler do_once) to fix a doubled file-descriptor bug. Tests use GoogleTest, perf checks use QuickBench, and benchmarks show only minor overhead in practice.

AI-written summary · about

  1. 0:00Start
  2. 4:50What's currently out there
  3. 9:48Drawbacks of a Singleton
  4. 11:19Reasons given for using a Singleton anyway
  5. 13:21Singleton or Not?
  6. 34:33Preserving The Application Binary Interface (ABI)
  7. 37:52Lazy Initialization - pre C++11
  8. 39:27Lazy Initialization - Modern C++
  9. 40:28Separation of Concerns
  10. 42:04Phased Introduction
  11. 45:47Initialization Dependencies
  12. 50:59Grouping Dependencies
  13. 51:39Multiple Dependencies
  14. 51:54Brute force
  15. 58:10Stateful Dependencies
~/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.