Assertions - Not for User Input
A pre-condition will not take care of correcting user input:
- You can’t enforce contracts on users
Example: A routine read_positive_integer that expects the interactive user to enter a positive number:
- It is wishful thinking to include a pre-condition of the form ‘require (input > 0)’.
- Include a post-condition instead: insure … //user re-entry until non-zero
// implemented as a method call?