3 ms·
asserts are just a language mechanism using which you implement preconditions/postconditions/invariants which are program correctness design constructs. Thus it
by rramadass 6y ago
asserts are just a language mechanism using which you implement preconditions/postconditions/invariants which are program correctness design constructs. Thus it is a systematic (i.e. not ad-hoc) way of using asserts correctly to guarantee program state.
I highly recommend reading Bertrand Meyer's papers "Applying Design By Contract" and "Design by Contract". They are well worth every programmer's time.