Principles

Principle Of Least Surprise

Don't talk to strangers (Law of Demeter)

A module should not know about the innards of the objects it manipulates.

Bad example:

Untitled

DonĀ“t Repeat Yourself (DRY)

Do not duplicate code

Keep It Simple, Stupid (KISS)

Make everything as simple as possible, but not simpler.

For example, if an Enumerable is suitable, do not use an Collection or even an List.

You Ain't Gonna Need It (YAGNI)

Only implement required features!

Do not create a platform, unless you are explicitly asked and payed for this.

Single Level of Abstraction (SLA)

Functions in a class: The abstraction level should decrease depth-first when reading from top to bottom.