Fighting code smells
-
Upload
silicon-straits-saigon -
Category
Technology
-
view
296 -
download
1
description
Transcript of Fighting code smells
Fighting code smellsPatterns to keep your code DRY
Code smells• Warning signs in the code which indicate
weaknesses in design.
=> slow down development and increase risk of bugs in future.
Code smells• Duplicated Code
Code smells• Long Method
Code smells• Feature Envy
Code smells• Data clumps
Code smells• Message chains
Code smells• Divergent change
Refactoring Patterns• Extract Method
• Pull up Method
• Form Template Method
• Replace Method with Method Object
• Extract Class
Refactoring Patterns• Demo: http://goo.gl/zpouEN
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
About @Vinh Bachsy• Author: Vinh Bachsy @: [email protected]
• 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