I need help remembering what book I read this from, It might have been Effective C++ or something, but I don’t remember. I was reading something that basically stated that functions have 3 promises:
- Validate input parameters to make sure they meet the expected input requirements
- Guaranteed to respect & maintain invariants
- Validate output parameters (returns & out params)
The book also had some nice names for this but for the life of me I don’t remember. It bothered me enough that I had to come to Stackoverflow to see if someone might recognize this and help me remember…
The name of the concept is Design by Contract: