Skip to content

Instantly share code, notes, and snippets.

@francoiskha
Forked from bobuss/Calisthenics.md
Created April 2, 2019 19:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save francoiskha/a027ef5e2fbc818bda1826b00fab8b6b to your computer and use it in GitHub Desktop.
Save francoiskha/a027ef5e2fbc818bda1826b00fab8b6b to your computer and use it in GitHub Desktop.
The 9 Rules of Object Calisthenics

Object Calisthenics outlines 9 basic rules to apply when performing the exercise:

  • One level of indentation per method.
  • Don't use the ELSE keyword.
  • Wrap all primitives and Strings in classes.
  • First class collections.
  • One dot per line.
  • Don't abbreviate.
  • Keep all classes less than 50 lines.
  • No classes with more than two instance variables.
  • No getters or setters.

Also see the "Your code sucks, let's fix-it" presentation by Rafael Dohms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment