blob: bd2513a29b51d2e049fbce381af0bf4b63f4fa3c [file] [log] [blame]
= Introduction =
Considerations when developing and reviewing source code.
= Sweeping Guidelines =
# Don't introduce code provisionally. Only insert code that is being used for a purpose. Corollary: Develop using vertical slices, instead of horizontal slices.
# Each CL does one thing. Don't insert refactorings into functional changes and vice-versa.
# Aim for small CLs.
# Don't send out "try-things-out" CLs.
# Make CLs direct. eg. no unneccesary indirection eg. put the String constant in instead of having unnecessary finals declared.
# Prefer plain/idiomatic/obvious over clever.
# Name things!
* make specific exception classes
* don't use "abstract" in class name
* don't use "impl" in class name
* name sub-blocks of code by converting to methods
= Particular considerations =
# Is the code thread safe? Read your code and check whether your code behaves well when multiple methods of an instance are executing simultaneously. Avoid settors to make classes immutable.
# Was equals considered?
# Was hashCode considered?
# Were exceptions considered? Are exceptions scoped precisely and accurately?
# Was toString considered? toString is helpful for testing and debugging.
# Does the code call exit? Don't call exit as it makes code un-libifable and means shutdown sequenceing is not understood.
# Please provide sufficient tests.
# BufferedImage is TYPE_INT_RGB
# Gui use done with SwingUtilities.invokeLater () so that SwingUtilities.isEventDispatchThread()
# Usually if a class uses Random, it is parameterizable on Random
# Was use of System.out and System.err considered? It's not a good
# Watch out for autoboxing and varargs producing undesireable behaviour.
# Consider public and final modifiers on classes and methods.
# Add javadoc