
Throw Granular and Helpful Exceptions in Your Code
Suppose the user has to enter his name in a field. He forgets. Your Java code throws a NullPointerException. This is probably meaningless to the end user and encompasses a large section of defects?not just a missing user name. How will the user know it’s his fault and correct himself?