Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Function Contracts in Practice Using C++

ACCU Conference via YouTube

Overview

Explore function contracts in C++ and their practical implementation in this comprehensive ACCU 2023 conference talk. Delve into the importance of well-designed function APIs, focusing on handling arguments outside the function's domain. Learn why narrow contracts with preconditions are often preferable to wide ones, and discover how contract-checking facilities can reduce software defects and improve maintainability. Examine the elements of function contracts, reasons for preconditions, and various contract types. Investigate contract violation handling, documentation styles, and scaling contract checking in real-world software. Gain insights from speaker Rostislav Khlebnikov, an experienced C++ software engineer and active member of the C++ Standards Committee, as he shares practical examples and design considerations for implementing function contracts effectively.

Syllabus

Introduction
Definitions
Contracts in software
Disclaimer
Elements of Function Contracts
Reasons for preconditions
Feasibility
Efficiency
Reliability
Maintainability
Extensibility
Order of Operations
Minimal Contract
Narrow Contract
Wide Contract Facilities
When a Contract is Violated
What can we do
Lets remind ourselves
assert
undefined behavior
contract checking
contract checking for control flow
contract checking vs input validation
contract checking vs unit testing
summary
documentation
style
example
return
combine
essential behavior
unless benefits
consistent order
additional notes
why we chose a style
example function
juice framework example
document your conference
contract checking at scale
offtheshelf handlers
prevent continuation
violation Handler
invoke Handler
Relative Work
Classification
Audit level checks

Taught by

ACCU Conference

Reviews

Start your review of Function Contracts in Practice Using C++

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.