Refactoring

2,583 views
2,478 views

Published on

Chirag and Aman\'s Refactoring workshop at Agile Mumbai 2008 conference

Published in: Technology
0 Comments
11 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,583
On SlideShare
0
From Embeds
0
Number of Embeds
21
Actions
Shares
0
Downloads
161
Comments
0
Likes
11
Embeds 0
No embeds

No notes for slide

Refactoring

  1. 1. Refactoring Aman & Chirag ThoughtWorks Pune
  2. 2. If it ain’t broken, why fix it?
  3. 3. Good programmers write code that humans can understand
  4. 4. You write code once; it gets read many times
  5. 5. To regain control on a program that is getting out of hands
  6. 6. To make the next change easier
  7. 7. This brings us to Refactoring
  8. 8. Refactoring in Action
  9. 9. Code Smells
  10. 10. Duplicated Code
  11. 11. Long Method
  12. 12. Comments
  13. 13. Divergent Change
  14. 14. Shotgun Surgery
  15. 15. Feature Envy
  16. 16. Lazy Class
  17. 17. Switch Statements
  18. 18. Primitive Obsession
  19. 19. Method Chains
  20. 20. Refactoring Catalog
  21. 21. Refactoring Catalog Composing methods
  22. 28. Refactoring Catalog Simplifying Conditional Expressions
  23. 36. Refactoring Catalog <ul><li>Making Method Calls Simpler </li></ul>
  24. 41. Accompanying XP Practices <ul><li>TDD : “Red - Green - Refactor” mantra </li></ul><ul><li>Continuous Integration </li></ul><ul><li>Collective Code Ownership </li></ul><ul><li>Pair Programming </li></ul>
  25. 42. Next steps for you <ul><li>Go read the book!!! </li></ul><ul><li>Practice small refactorings </li></ul><ul><ul><li>Explore the “Refactor” menu of your IDE </li></ul></ul><ul><li>Keep a look out for code smells in your project </li></ul>
  26. 43. To sum it up… <ul><li>Refactoring is a good technique to clean up code </li></ul><ul><li>Refactoring leads to better design (especially with Test-Code-Refactor cycles) </li></ul><ul><li>Most important of all: it leaves a nice feeling at the end of it all! </li></ul>
  27. 44. Thank You <ul><li>Aman King </li></ul><ul><ul><li>[email_address] </li></ul></ul><ul><li>Chirag Doshi </li></ul><ul><ul><li>[email_address] </li></ul></ul>

×