~/talk

Back to Basics: Object-Oriented Programming

Talkat CppCon 2019 · 2019-09-15..09-20· [software-architecture]
name:Jon Kalb
github:boostcon
slides:none on file

Argues that runtime polymorphism in C++ still matters for “millions” of legacy users and gives concrete rules: model public inheritance as an is-a relationship, make non-leaf classes abstract (pure virtuals) to avoid slicing, use the non-virtual interface so base pre/post work is enforced, always declare destructors virtual or deleting via base is undefined, mark overrides with override, avoid mixing overloading and overriding, don’t call virtuals in constructors/destructors, prefer dynamic_cast for downcasts but refactor to eliminate casts. Example: console/file/SMS logger shows surprising compile-time defaults and ctor dispatch.

AI-written summary · about

  1. 0:00Intro
  2. 2:46Agenda
  3. 3:38Definition
  4. 3:53Alternatives
  5. 4:41ObjectOriented Programming
  6. 5:13Logging
  7. 6:35Base Class
  8. 7:17Client Code
  9. 9:14Loggers
  10. 9:57Subtype
  11. 10:44Surprise
  12. 10:59Why is this important
  13. 11:54Herb and Andre
  14. 12:32Virtual Dispatch
  15. 12:49Design Best Practices
  16. 13:26Public Inheritance Models
  17. 13:52Derived Classes
  18. 14:46Logging and Display
  19. 15:54Nonleaf Classes
  20. 18:35Scotts Solution
  21. 19:14Scots Guideline
  22. 23:28Nonvirtual interface idiom
  23. 23:53Nonvirtual logger
  24. 24:40Pre and post
  25. 25:44Each interface can take its natural shape
  26. 27:28Public virtual has two responsibilities
  27. 27:42Public virtual has one responsibility
  28. 27:52Nonvirtual interface
  29. 28:37Best practice
  30. 28:48Build things
  31. 29:31Test
  32. 31:10Create a file logger
  33. 32:02Make base class instructors virtual
  34. 32:34Virtual keyword
  35. 32:49Log message
  36. 33:04Override
  37. 33:56Scopes
  38. 34:59Drive classes
  39. 35:35Function overloading
  40. 37:38Dont mix overloading and overriding
  41. 37:55Avoid hiding inherited names
  42. 39:35Should Derived classes have a default
  43. 39:59DIY violation
  44. 40:32Overloading
  45. 43:41Virtual Functions
  46. 44:12SMS Logger API
  47. 45:39Upcast
  48. 46:20Downcast
  49. 46:34Static Cast
  50. 47:41Dynamic Cast
  51. 50:41Minimize Cast
  52. 51:53Questions
~/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.