Object Calisthenics are programming exercises, formalized as a set of 9 rules invented by Jeff Bay in his book The ThoughtWorks Anthology. The word Object is related to Object-Oriented Programming. The word Calisthenics is derived from greek, and means exercises under the context of gymnastics. By trying to follow these rules as much as possible, you will naturally change how you write code. It doesn’t mean you have to follow all these rules, all the time. Find your balance with these rules, use some of them only if you feel comfortable with them.
Only One Level Of Indentation Per Method Don’t Use The ELSE Keyword Wrap All Primitives And Strings First Class Collections One Dot Per Line Don’t Abbreviate Keep All Entities Small No Classes With More Than Two Instance Variables No Getters/ Setters/ Properties
Ref:
- "Your code sucks, let's fix-it", presentation by Rafael Dohms.
- Object Calisthenics, by William Durand