logoalt Hacker News

samivtoday at 7:02 PM1 replyview on HN

That's why you define your own assert macro and keep in on unconditionally. Your programs will be better for it.


Replies

jandrewrogerstoday at 7:26 PM

An assertion can be arbitrarily expensive to evaluate. This may be worth the cost in a debug build but not in a release build. If all of assertions are cheap, they likely are not checking nearly as much as they could or should.

show 1 reply