Pick 1 or 2 to add an extra challenge when doing a kata. The constraints have been gathered from across the web 1 with a few of our own thrown in.
The Constraints
- Only four lines per method - After refactoring
- Immutables only
- Only one level of indentation per method
- Do not use else
- No passing of primitives between methods as parameters or return types
- No Properties/Getters/Setters
- No loops
- No void returns - All methods must return something
- No conditional statements
- No chained method calls - 1 dot per statement
- No objects
- No mouse
- No debugging
- Only static methods
- Only static fields
- One level of abstraction per method
- Let the code be read as if it was a small story.
- Collapse methods and read only function names top down
- Communicate clearly, meaningful naming take from the Domain (Kata)
- Only void returns - All methods must return nothing
- Strictly follow the rule of three
- Allow duplication to emerge at least 3 times before removing it
- 2 refactorings after each passing test
- Do not use any classes with more than two instance variables
- Zero constructor arguments
- No more than 2 parameters per method