AgileWorks Romania

Coding Dojo – The 9 rules of Object Calisthenics

Object Calisthenics are programming exercises, formalized as a set of 9 rules suggested by Jeff Bay in the book "The ThoughtWorks Anthology".

These rules focus on maintainability, readability, testability, and comprehensibility of your code. 

The rules are:

1. Only One Level Of Indentation Per Method
2. Don’t Use The ELSE Keyword
3. Wrap All Primitives And Strings
4. First Class Collections
5. One Dot Per Line
6. Don’t Abbreviate
7. Keep All Entities Small
8. No Classes With More Than Two Instance Variables
9. No Getters/Setters/Properties

We will refactor an existing codebase using only the 9 rules above.


A Coding Dojo is a team practice format that accelerates knowledge transfer and sharing skills between team members. With an experienced facilitator, it is also a way of learning by applying various techniques.


The following skills are typical candidates for improvement during a dojo:

• Refactoring
• Simple design
• Clean code
• Improving pair programming technique
• How to safely modify code you don't understand (usually legacy code)
• Learning a new programming language
• Unit testing
• Test driven development

In addition, coding dojo can be used by a team as a collective and structured way of solving difficult or risky problems related to production, like fixing a bug or redesigning parts of the application.

How it works?

The basic format of a coding dojo:

• All developers and the facilitator gather in a room.
• The facilitator introduces the purpose and the format of the coding dojo.
• One laptop with a functional development environment is connected to a projector.
• Two developers pair program on the laptop. The others are in the room, watching the code changes.
• Every 7 minutes, one developer leaves the laptop and the next one from the room takes his place.
• After a specified period of time (usually around two hours), the dojo ends with a retrospective.

Filed under: Comments Off
Comments (0) Trackbacks (0)

Sorry, the comment form is closed at this time.

Trackbacks are disabled.