Your SlideShare is downloading. ×
Revisiting Refactoring
Revisiting Refactoring
Revisiting Refactoring
Revisiting Refactoring
Revisiting Refactoring
Revisiting Refactoring
Revisiting Refactoring
Revisiting Refactoring
Revisiting Refactoring
Revisiting Refactoring
Revisiting Refactoring
Revisiting Refactoring
Revisiting Refactoring
Revisiting Refactoring
Revisiting Refactoring
Revisiting Refactoring
Revisiting Refactoring
Revisiting Refactoring
Revisiting Refactoring
Revisiting Refactoring
Revisiting Refactoring
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Revisiting Refactoring

969

Published on

A tour de force of Refactoring, Refuctoring, Code Smells, and Code Smiles

A tour de force of Refactoring, Refuctoring, Code Smells, and Code Smiles

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
969
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
17
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Revisiting Refactoring Learning From the Past Improving the Future
  • 2. What We Will Cover
    • What is a Refactor
    • What is a Refuctor
    • What are Code Smells
    • What are Code Smiles
    • How does this change what we do
  • 3. Defining Refactoring
    • Code refactoring is the process of changing a computer program's internal structure without modifying its external functional behavior or existing functionality
    • improve internal non-functional properties of the software
    • improve code readability
    • to simplify code
  • 4. A List of Refactors
    • http://www.refactoring.com/catalog/
  • 5. Observations About Refactoring
    • Refactoring improves the design of software
    • – without refactoring, a design will “decay” as people make changes to a software system
    • • Refactoring makes software easier to understand
    • – because structure is improved, duplicated code is eliminated, etc.
    • • Refactoring promotes a deep understanding of the code at hand by tearing it apart and putting it back together again
  • 6. What We Will Cover
    • What is a Refactor
    • What is a Refuctor
    • What are Code Smells
    • What are Code Smiles
    • How does this change what we do
  • 7. Defining Refuctoring
    • Refuctoring is the process of taking a well-designed piece of code and, through a series of small, reversible changes, making it completely unmaintainable by anybody except yourself.
    • Often occurs when refactoring is not disciplined
    • Occurs when changes are made at the last minute
  • 8. A Sampling of Refuctors
    • Inconsistent Naming Conventions
    • Module Gravity Well
    • Useless prefixes / suffixes “Pig Latin”
    • Reusing names
    • Often introduced accidentally in a rush
  • 9. What We Will Cover
    • What is a Refactor
    • What is a Refuctor
    • What are Code Smells
    • What are Code Smiles
    • How does this change what we do
  • 10. Defining Code Smells
    • A Code Smell is a hint that something has gone wrong somewhere in your code
    • A Code Smell is a hint that something might be wrong, not a certainty.
    • Calling something a CodeSmell is not an attack; it's simply a sign that a closer look is warranted.
  • 11. A List of Code Smells
    • Duplicate Code
    • Large Method
    • Marge Class
    • Inappropriate Intimacy
    • Feature Envy
    • Switch Statements
    • Comments
  • 12. Observations About Code Smells
    • Smells are guidelines
    • Smells should not be dogmatic
    • Smells should introduce a sense of humor to code reviews
    • Code smells have associated Refactors to address specific smells
  • 13. What We Will Cover
    • What is a Refactor
    • What is a Refuctor
    • What are Code Smells
    • What are Code Smiles
    • How does this change what we do
  • 14. Defining Code Smiles
    • A code "smile" is some aspect of the code that makes other developers smile when they have to maintain it.
    • Code Smiles add up to code that is easily maintained
  • 15. A List of Code Smiles
    • Common sense naming conventions
    • Cohesive and loosely coupled modules
    • Elegant abstractions
    • Lack of duplication
    • A close resemblance to the application domain
  • 16. Observations About Code Smiles
    • Code smiles do not happen by accident
    • Code full of Smiles can deteriorate without careful attention
    • Code smiles may also require supporting documentation or one on one training
  • 17. What We Will Cover
    • What is a Refactor
    • What is a Refuctor
    • What are Code Smells
    • What are Code Smiles
    • How does this change what we do
  • 18. Defining Prefactoring
    • Simple steps to take to prevent common problems before they arise
    • Conduct “Lessons Learned” meetings from previous projects
    • Identify common problems
    • Take steps at every stage to avoid issues known to cause problems in the past
  • 19. Towards a Catalog of Prefactors
    • Identify a recurring issue
    • Define a preventative measure
    • Verify that the prevention is being followed
    • Verify that the recurring issue is reduced
    • Refine the preventative measure
  • 20. Sample Prefactoring
    • Inappropriate Intimacy
    • Object model not resembling Business Model
    • Separation By Interfaces
    • Read code aloud to customers
  • 21. Where to get More Information
    • http ://www.refactoring.com/catalog/index.html
    • http://www.waterfall2006.com/gorman.html
    • http://www.simple-talk.com/dotnet/.net-framework/code-deodorants-for-code-smells/
    • http://www.simple-talk.com/author/nick-harrison/

×