Always follow these timeless principles when writing code, ordered by priority:
-
KISS (Keep It Simple, Stupid)
- Keep the solution as simple as possible. Avoid unnecessary abstractions, premature optimization, or clever hacks.
-
Optimize for Cognitive Load
- Code should fit in human working memory. Prioritize readability, clarity, and simplicity over cleverness.
-
Separation of Concerns
- Ensure each module/class has a clear and distinct purpose. No mixing of unrelated responsibilities.