Bad exception example (Joke)

In the chapter on writing a Java client, you give the example:

interface Child {
void askToCleanUp() throws Tantrum;
}

This is bad programming practice, as an exception should not be used for expected normal behaviour.

Comments

  • matthewmatthew NL, CanadaMember Matthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications Engine ✭✭✭
    Perhaps we should change it to:

    interface Child {
    void askToCleanUp() throws DoesAsTold;
    }

    :D

    Regards, Matthew
Sign In or Register to comment.