This is just a list about programming principles that I’m making for myself. These should be instinctive to any developer.
- DRY: Don’t Repeat Yourself
- KISS: Keep It Simple, Stupid
- Law of Demeter, “When one wants a dog to walk, one does not command the dog’s legs to walk directly; instead one commands the dog which then commands its own legs”
- SOLID
- Single responsibility principle
- Open/closed principle
- Liskov substitution principle
- Interface segregation principle
- Dependency inversion principle
- CQS: Command-Query Separation, “Asking a question should not change the answer”
- YAGNI: You aren’t gonna need it
- Four rules of simple design: passes the tests, reveals intention, no duplication, fewest elements.
- Balanced Abstraction principle
- Tell, Don’t Ask
- Code smells, including: duplicated code, long method, God object, feature envy, etc.
- … anything important left?