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.
One level of indentation per methodNo else keywordWrap all primitives and stringsUse only one dot per lineDon’t abbreviate names but keep them shortKeep all entities smallNo more than two instance variables per classUse first-class collectionsDon’t use any getters/setters or propertiesI'm still trying to wrap a prototype project around them, and the partial results are astonishing.
Read more...