Object Calisthenics
rules object programming designYet again I come here to share something learned from very smart people. Initially when I saw these rules my head exploded. Even though they are reasonable rules, they break the traditional non-object-oriented I've been doing for a while.
Sources
- One level of indentation per method
- No else keyword
- Wrap all primitives and strings
- Use only one dot per line
- Don’t abbreviate names but keep them short
- Keep all entities small
- No more than two instance variables per class
- Use first-class collections
- Don’t use any getters/setters or properties
Sources