Keep things as simple as possible, but not simpler (KISS)
Before doing things twice, think twice (DRY)
If things start to get too complex, decomposition is needed.
Divide et impera - If things get too complex, split them up into smaller pieces and code them separately.
If decomposition does not help, management is needed.
Keep in mind: There's a beauty in design. If you find something in your code which looks quite ugly, there is something wrong with it. You probably can do it better.