Refactoring guidelines


#1
  • Stay in the green while refactoring
  • Commit as often as possible
  • Refactor readability before design
    • Format
    • Rename
    • Remove
    • Extract
    • Reorder
  • Change design
    • Extract private methods from deep conditionals.
    • Extract smaller private methods from long methods, and encapsulate cryptic code in private methods.
    • Return from methods as soon as possible.
    • Encapsulate where we find missing encapsulation.
    • Remove duplication.