Side Effects
Avoid modifying static objects
Example:
System.out
Don't print error messages to
System.out
:
if (newMessages.isFull()) System.out.println("Sorry--no space");
Your classes may need to run in an environment without
System.out
Rule of thumb: Minimize side effects
previous
|
start
|
next
.... [Slide 27] ....