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
72
Upvotes
r/cpp • u/Specific-Housing905 • Feb 26 '26
View all comments
Show parent comment
4
u/38thTimesACharm Feb 28 '26
A number of prominent influencers in this space seem to think any safety-related feature must work 100% of the time and prevent 100% of UB, and be impossible to circumvent or disable, or it is useless at best and harmful at worst.
IMO, these people fail to consider the real world, where millions of lines of code are maintained by companies who don't give a crap about undefined behavior, run 4+ year EOL operating systems on their servers, leave SSH daemons running with no authentication in production ("the customer won't connect it to the Internet, probably"), and distribute anti-phishing advice that requires employees to click a link and enter their password to access.
If a feature causes insurmountable headache to implement, these companies simply won't use it.
They will, however, enable a feature that catches bugs in their code and helps their engineers work faster. And it will find and fix some of the UB, and that will be good for the world.