Programming Principles

General Principles

Write as straight forward code as possible.
Don't write code for the future. Write only what is needed and keep it clean so the extension will be easy.
Make sure that You follow conventions for whatever You do. In that way, code won't be surprising to anyone.
Separate code into distinct sections. That's the backbone of clean architecture.
Always look for the root cause of the problem. Otherwise, it will come back in the future.
Leave the code cleaner than You found it.

DRY (Don’t Repeat Yourself)

Create small, reusable functions. Don't copy algorithms because of small differences.
Keep data in database and logic in one place.
Don't repeat comments – avoid them at all costs – Write better code instead!

SOLID Principles

A class should be having one and only one responsibility.
A class should be open for extension but closed for modification.
Parent class should be easily substituted with its child class.
Many client-specific interfaces are better than one general interface.
Classes should depend on abstraction but not on concretion.

CUPID Principles

Plays well with others. API should be narrow and opinionated. Code should have minimal dependencies and intention-revealing.
Does one thing well. Aim at a simple, consistent model.
Code does what you expect. Code should be deterministic and observable.
Feels natural. It's easy to understand, intuitive.
The solution reflects the problem in language and structure.


Sources:
Clean Code: A Handbook of Agile Software Craftsmanship (Robert C. Martin)
The Clean Coder: A Code of Conduct for Professional Programmers (Robert C. Martin)