3 ms·
Because the very raison d'etre of asserts is to be a compile time/test time check. If you wanted them to run in production, you wouldn't use an assert, you woul
by TZubiri 1y ago
Because the very raison d'etre of asserts is to be a compile time/test time check. If you wanted them to run in production, you wouldn't use an assert, you would just run an if. Otherwise what's an assert to you? A mildly convenient sugar syntax alternative to if statements?
- flir 1y ago> A mildly convenient sugar syntax alternative to if statements? Yup.
- kevinqi 1y agoright, it is just syntactic sugar, but if that wasn't helpful then why have it in dev either? I find it more confusing to have asserts be stripped, which creates an implicit dev/prod discrepancy
- swiftcoder 1y agoThat a semantic we've all just sort of inherited from C - I don't know we're required to be bound by it forever. The word itself doesn't imply that assertions would be contextually disabled.
- TZubiri 1y agosemantics are as if not more important than the technical execution. Bits are all abstractions anyways, what's important is the meaning we assign to them.