Björn wrote his first program in 1980. After completing his MSc in CS and Engineering in 1994, programming has been the primary source of income, mostly from writing embedded software for communications systems. Occasionally Björn has been seen tinkering with unorthodox software constructs, pondering "what can be done with this?" He lives in Stockholm
Design by Contract is a technique to clearly express which parts of a program has which responsibilities. In the case of bugs, contracts can mercilessly point a finger at the part that violated the contract.
Contracts are coming as a language feature in C++20. I will show how they can make your interfaces clearer with regards to use, but also point out pitfalls and oddities in how contracts are handled in C++.
Writing good contracts can be difficult. I intend to give you guidance in how to think when formulating contracts, and how to design your interfaces such that good contracts can be written, because contracts have effects on interface design.
Warning: Parts of the contents are personal opinion.