Each time you wirte a method or constructor,you should think about what restrictions exists
on its parameters.You should document these restrictions and enforce them with explict checks
at the begining of the method body.
It is important to get into the habit of doing this.The modest work that it entails will be paid back
with interest the first time a validity check fails.
But do not infer from this item that arbitrary restrictions on parameters are a goodthing. On the contrary, you should design methods to be as general as it is practi-
cal to make them. The fewer restrictions that you place on parameters, the better,
assuming the method can do something reasonable with all of the parameter val-
ues that it accepts.