Fighting code smells

701 views

Published on

Follow us on :
Facebook: https://www.facebook.com/siliconstraitssaigon
Website: http://www.siliconstraits.vn/
Blog: http://blog.siliconstraits.vn/

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

  • Be the first to like this

No Downloads
Views
Total views
701
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
12
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Fighting code smells

  1. 1. Fighting code smells Patterns to keep your code DRY
  2. 2. Code smells • Warning signs in the code which indicate weaknesses in design. => slow down development and increase risk of bugs in future.
  3. 3. Code smells • Duplicated Code
  4. 4. Code smells • Long Method
  5. 5. Code smells • Feature Envy
  6. 6. Code smells • Data clumps
  7. 7. Code smells • Message chains
  8. 8. Code smells • Divergent change
  9. 9. Refactoring Patterns • Extract Method • Pull up Method • Form Template Method • Replace Method with Method Object • Extract Class
  10. 10. Refactoring Patterns • Demo: http://goo.gl/zpouEN
  11. 11. Read more… • Refactoring: Improving Design of Existing Code - by Martin Flower • Refactoring: Ruby Edition - by Jay Fields, Shane Harvie, Martin Flower and Kent Beck • http://ghendry.net/refactor.html • http://sourcemaking.com/refactoring • Reek: Code smells detector - https://github.com/ troessner/reek
  12. 12. About @Vinh Bachsy • Author: Vinh Bachsy @: bsdvinhuit@gmail.com • You can follow me at: • https://plus.google.com/+VinhBachsy • https://www.facebook.com/vinh.bachsy • And the Saigon.rb Meetup: • http://www.meetup.com/saigon-rb/ • https://www.facebook.com/saigonrb

×