Difference between revisions of "Coding standards"
From DarkWiki
(Created page with "==Object properties== ===Getters=== * Must not throw exceptions * Must be repeatable") |
(→Getters) |
||
| Line 3: | Line 3: | ||
===Getters=== | ===Getters=== | ||
| − | * | + | *Do not throw exceptions*. A getter should provide access to the field, and should not result in an exception. There are occasions when this rule can be relaxed (such as indeterminable exceptions like OutOfMemoryException), but things like NullPointerExceptions should not occur. |
| − | * Must be repeatable | + | *Must be repeatable*. |
Revision as of 12:53, 28 May 2019
Object properties
Getters
- Do not throw exceptions*. A getter should provide access to the field, and should not result in an exception. There are occasions when this rule can be relaxed (such as indeterminable exceptions like OutOfMemoryException), but things like NullPointerExceptions should not occur.
- Must be repeatable*.