3 ms·
The article gets things flatly wrong from its first, ah, assertion. Asserts aren't for validation: the condition is supposed to be impossible to be false, just
by chuckadams 2mo ago
The article gets things flatly wrong from its first, ah, assertion. Asserts aren't for validation: the condition is supposed to be impossible to be false, just not provable by the type system. If invalid input can come through normal operation of the program, you use a normal runtime check, not an assert.
- rramadass 2mo ago> Asserts ... the condition is supposed to be impossible to be false, just not provable by the type system Very nicely said!