a better way to learn refactoring

Download A better way to learn refactoring

Post on 05-Dec-2014

273 views

Category:

Technology

2 download

Embed Size (px)

DESCRIPTION

 

TRANSCRIPT

  • 1. A Better Way To Learn Refactoring @rafael_sperling
  • 2. @rafael_sperling
  • 3. Long Method Large Class Primitive Obsession Long Parameter List DataClumps Switch Statements Temporary Field Refused Bequest ... Bad Code Smell Examples @rafael_sperling
  • 4. Single-Line Statements Block Statements Methods Classes Different Levels of Refactoring @rafael_sperling
  • 5. Extract method for only one responsability Eliminate duplication through decomposition Allow for decomposition without drawbacks of duplication The Ultimate Goal for Refactoring @rafael_sperling
  • 6. For every number from 0 to 100, If it is divisible by 3, print "Fizz", If it is divisible by 5, print "Buzz", If it is divisible by 3 and 5, print "FizzBuzz" FizzBuzz & The Art of Refactoring @rafael_sperling
  • 7. @rafael_sperling Eliminate Duplicate Write Lines Calls
  • 8. @rafael_sperling Eliminate Duplicate Write Lines Calls
  • 9. @rafael_sperling Extracted isFuzzi and isBuzzi Variables
  • 10. @rafael_sperling Invert IF Statements
  • 11. @rafael_sperling Extract Display Actual Number Method
  • 12. @rafael_sperling Extracted Run Method
  • 13. @rafael_sperling Moved FizzBuzz Region Into Separate Class
  • 14. Thanks! rafaelsperling@gmail.com
  • 15. References https://vimeo.com/43659053 @rafael_sperling

Recommended

View more >