CSC/ECE 517 Fall 2009/wiki1a 8 rr: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 5: | Line 5: | ||
==Categories of Code refactoring== | ==Categories of Code refactoring== | ||
*Improve readability and code reuse | |||
One of the major motivation for code refactoring is readability. | One of the major motivation for code refactoring is readability. | ||
**Improve names | |||
***Renaming methods/variables etc to more meaningful names is a good practice. | |||
display() => displayStudentNames | display() => displayStudentNames | ||
***Extract package - Extract a sub package depending on their gross dependencies or usages. | |||
Revision as of 06:00, 8 September 2009
Categorization of code refactoring
What is Code Refactoring?
Code Refactoring is a technique of reorganization code to change its structure but at the same time preserving the basic functionality of the code. There are many kinds of code refactoring. This wiki tries to categorize these types of refactoring so that it's easy for people to learn these patterns and remember them.
Categories of Code refactoring
- Improve readability and code reuse
One of the major motivation for code refactoring is readability.
- Improve names
- Renaming methods/variables etc to more meaningful names is a good practice.
- Improve names
display() => displayStudentNames
- Extract package - Extract a sub package depending on their gross dependencies or usages.
- Code management
- Allow abstraction
- Change of logic
- Merging/Reduction of code
Conclusion
References
External references
- Martin Fowler's homepage about refactoring
- Smells to Refactorings Quick Reference Guide
- Refactoring: Improving the Design of Existing Code by Martin Fowler available at Google Books