Refactoring in the Small
- Keep code's functional properties, while improving non-functional
properties
- Readability
- Maintainability
- Portability
- Reliability
- Can be performed in the large (architecture), or in the small (code elements)
Illustrative Example
if (*cp == 0)
break;
if (*cp != ',' && *cp != ' ')
goto bad;
cp++;
Changed into:
if (*cp == 0)
break;
else if (*cp != ',' && *cp != ' ')
goto bad;
else
cp++;