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, you may use the code conventions defined by Sun. In particular, you may follow the Naming Conventions (section 9, page 14). We present here the main elements of this section :

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.