Stroustrup objects to adding Contracts to C++
jmh530
john.michael.hall at gmail.com
Tue Nov 10 15:59:11 UTC 2026
On Tuesday, 10 November 2026 at 15:38:47 UTC, Paul Backus wrote:
> [snip]
>
> The biggest issue with contracts compared to unit tests is that
> unit test failures happen at build/CI time, whereas contract
> failures happen at runtime. So even if you are using contracts
> to check invariants, you're still going to want unit tests to
> actually exercise them. And if you're already writing those
> tests anyway, the value added by the contracts is pretty
> minimal.
> [snip]
I thought the issue with contracts was something along the lines
of "why put them in the contract block vs just have regular
asserts."
More information about the Digitalmars-d
mailing list