~/talk

Avoid Misuse of Contracts!

Talkat CppCon 2019 · 2019-09-15..09-20· [software-architecture, c-and-cpp]
links:none on file
slides:none on file

Argues that contract checks exist to catch programmer bugs: in a correct program function contracts are never violated and removing contract checks must not change essential behavior (only performance). Shows that using language or macro CCFs (GSL or future C++ contracts) as input validation or to drive control flow is wrong — examples include inserting into a set inside a predicate and relying on asserts for IO. Recommends testing, defining an application envelope, and avoiding side-effecting predicates.

AI-written summary · about

  1. 0:00Introduction
  2. 0:32What this talk is about
  3. 1:12Contract terminology
  4. 3:19Two types of contracts
  5. 5:00Design by contract
  6. 11:55John Wake
  7. 12:29Out of contract
  8. 15:26Check preconditions
  9. 16:15How to check
  10. 18:05Two principles
  11. 19:10Misuse of contracts
  12. 19:32Preconditions
  13. 23:17Side effects in predicates
  14. 24:20How to check if a value is corrupted
  15. 25:42Side effects
  16. 29:30Input validation
  17. 29:53What is an input
  18. 30:42Application envelope
  19. 31:32Example application
  20. 36:26Application example
  21. 42:25Additional thoughts
  22. 46:18Contract assert
  23. 48:03Application development envelope
  24. 49:36No side effects
  25. 51:41Assertions
  26. 55:42Optimization
  27. 56:51Conclusion
~/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.