All Questions
1 question
4
votes
3
answers
9k
views
When to add a precondition and when to (only) throw an exception?
I am learning about preconditions and when to use them. I have been told
that the precondition
@pre fileName must be the name of a valid file
does not suit in the following code:
/**
Creates a new ...