Difference between revisions of "Coding standards"

From DarkWiki
Jump to: navigation, search
(Object properties)
(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.
+
'''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 13:02, 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*.