Readable and Reusable Code

When you write code, you must take care that your code will be easy to maintain.
To achieve this goal, your code must in particular be readable and easy to reuse.
Here are some rules you may follow in that aim :

You must follow the practices followed by the programmers using the same laguage. In Java, that means that you must resepect the code conventions defined by Sun. We present here the main elements of this document :

Interfaces and implementations must be clearly separated.

The visibility of a variable, method or class must be limited to its use.

You must always avoid code duplication.

The name of an identifier must be meaningful or usual.

Commentaries must explain the code and how to use it, not rephrase it.