This document defines code style used for the Shongo project and all its
subprojects. Most of them are available as IntelliJ Idea rules in the "Shongo
Code Style.xml" file. Copy it to your home directory under
.IntelliJIdea11/config/codestyles to make it available. Each new project should
use per-project code style settings - copied from this code style.



Basic Formatting
----------------
-Use only spaces, and indent 4 spaces at a time.

-Each line of text in your code should be at most 120 characters long.


Block Formatting
----------------
-Use curly braces for conditional, loop and other composed
 statements that contains even single line of code (if, else,
 while, for, etc).

    if (i < 100) {
        i++;
    }

-Indenting as Compact Control Readability
 http://en.wikipedia.org/wiki/Indent_style#Compact_Control_Readability_style

-Opening curly bracket on the same line

-Closing curly bracket on a standalone line

-Else statement on new line

-While keyword in do-while statements keep on the same line as right
 curly bracket.

-Boolean expression and ternary expression is enclosed by round brackets.

    int y = (x == 1 ? 0 : 1);
    return (compareTo(dateTime) < 0);


Documentation
-------------
-Use documentation comments for classes and methods.

-Write description and @author for classes

-Write description and @param, @return, @throws for methods

-Write comments to overridden method only when it brings a new description.
 Otherwise clever IDEs are able to show Doc from the super method.


Objects
-------
-Use List<T> instead of arrays T[] in function input and output values

-Try to implement equals by java contract (reflexive, symmetrical, transitive)

-Implement hashCode when equals is implemented

-Try to create immutable objects, all attributes final, without setters, modifiers return new objects



