User:AVS/Refactoring Rules

From VCMI Project Wiki
< User:AVS
Revision as of 08:52, 18 January 2013 by AVS (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
  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.