CSC/ECE 517 Fall 2009/wiki1a 8 rr: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
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.
##Improve names
###Renaming methods/variables etc to more meaningful names is a good practice.
  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==
==Conclusion==

Revision as of 05:59, 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

  1. Improve readability and code reuse

One of the major motivation for code refactoring is readability.

    1. Improve names
      1. Renaming methods/variables etc to more meaningful names is a good practice.
 display()  => displayStudentNames
      1. Extract package - Extract a sub package depending on their gross dependencies or usages.



  1. Code management
  2. Allow abstraction
  3. Change of logic
  4. Merging/Reduction of code


Conclusion

References

External references