Joe Soltzberg

55%
Flag icon
For example, it is not uncommon that index values must be non-negative and object references must be non-null. You should clearly document all such restrictions and enforce them with checks at the beginning of the method body. This is a special case of the general principle that you should attempt to detect errors as soon as possible after they occur. Failing to do so makes it less likely that an error will be detected and makes it harder to determine the source of an error once it has been detected.
Joe Soltzberg
I wish there was better compile-time, language-level support for this
Effective Java
Rate this book
Clear rating
Open Preview