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

  1. Only four lines per method - After refactoring
  2. Immutables only
  3. Only one level of indentation per method
  4. Do not use else
  5. No passing of primitives between methods as parameters or return types
  6. No Properties/Getters/Setters
  7. No loops
  8. No void returns - All methods must return something
  9. No conditional statements
  10. No chained method calls - 1 dot per statement
  11. No objects
  12. No mouse
  13. No debugging
  14. Only static methods
  15. Only static fields
  16. One level of abstraction per method
    1. Let the code be read as if it was a small story.
    2. Collapse methods and read only function names top down
  17. Communicate clearly, meaningful naming take from the Domain (Kata)
  18. Only void returns - All methods must return nothing
  19. Strictly follow the rule of three
    1. Allow duplication to emerge at least 3 times before removing it
  20. 2 refactorings after each passing test
  21. Do not use any classes with more than two instance variables
  22. Zero constructor arguments
  23. No more than 2 parameters per method