3 ms·
That's called "Design By Contract". You formally specify pre/post-conditions of functions and invariants of classes (such as "cap >= len" in this case), and hav
by majewsky 11y ago
That's called "Design By Contract". You formally specify pre/post-conditions of functions and invariants of classes (such as "cap >= len" in this case), and have the compiler enforce that automatically, e.g. by inserting runtime checks.