Know the common sources of complexity

One of the goals of writing good programs is simply to avoid complexity.

The three most common sources of complexity are:

When you see code becoming complex in the above ways, it's always useful to start thinking about alternatives.

See Also :
Immutable objects