Difference between revisions of "User:AVS/Refactoring Rules"

From VCMI Project Wiki
Jump to: navigation, search
(Created page with "# No code duplication. # No magic nombers ## use constant if value comes from code (mostly for enums) ## use configuration if value comes from configuration (text ids from gen...")
 
(No difference)

Latest revision as of 08:52, 18 January 2013

  1. No code duplication.
  2. No magic nombers
    1. use constant if value comes from code (mostly for enums)
    2. use configuration if value comes from configuration (text ids from general text handler).
    3. use configuration for widgets
    4. use string value to retrieve configuration parameters.
  3. Low coupling
    1. include only indispensable headers
    2. try use all classes from included headers. Consider refactoring if U use only small part of "known classes"
  4. (*) (!) we need automated testing to use refactoring heavily.