4 ms·
You can use "Design by Contract" (https://en.wikipedia.org/wiki/Design_by_contract https://en.wikipedia.org/wiki/Design_by_contract) in Rust: https://docs.rs/c
by thesuperbigfrog 3y ago
You can use "Design by Contract" (https://en.wikipedia.org/wiki/Design_by_contract https://en.wikipedia.org/wiki/Design_by_contract) in Rust:
https://docs.rs/contracts/latest/contracts/ https://docs.rs/contracts/latest/contracts/
Ada has Design by Contract built into the language (not a library):
https://learn.adacore.com/courses/intro-to-ada/chapters/contracts.html https://learn.adacore.com/courses/intro-to-ada/chapters/cont...
DbC is awesome because it formalizes what conditions must exist before and after a piece of code runs and defines who (caller vs. callee) is responsible for what parts.