r/cpp • u/Specific-Housing905 • Feb 26 '26
The Joy of C++26 Contracts - Myths, Misconceptions & Defensive Programming - Herb Sutter
https://www.youtube.com/watch?v=oitYvDe4nps&t=1s
68
Upvotes
r/cpp • u/Specific-Housing905 • Feb 26 '26
View all comments
Show parent comment
5
u/James20k P2005R0 Feb 26 '26
The problem is its not really clear that contracts are going to meet many people's needs. Its also not clear that its even possible to implement contracts, which isn't reassuring
C++ has a lot of broken cruft lying around, that serves as a trap for no real reason. The effort that's been expended on contracts could have been spent on getting reflection in much earlier, creating an abi evolution strategy, fixing <filesystem>/<random>/the standard library organisation, fixes to modules etc
There's no free lunch - the standardisation time is limited and its not clear that contracts have been a good use of it