logoalt Hacker News

Jtsummers • yesterday at 6:42 PM • 1 reply • view on HN

> You can't use them for safety checks, because you must assume they won't be run.

This is also true of assert, though. It can be compiled out so shouldn't be used for anything that must run.


Replies

20k • yesterday at 8:48 PM

Its pretty easy for me to guarantee that my asserts will all always be run via NDEBUG. I can't make that same guarantee for contracts

➕ show 1 reply