Besides the transformation rules to upgrade all the VB6 language constructions, the VBUC also has an extensive set of Code Refactoring rules designed to improve the resulting product quality.
There are many code patterns found in VB6 that can be upgraded to a more optimized .NET counterpart. In other cases, the resulting product readability can be enhanced by applying some refactoring as well.
All the Code Refactoring transformation rules can be categorized into two different areas:
- “If Else If” structures to “switch” blocks
- “Return” keywords for functions
- “For…each” instead of iteration variables
- “IsMissing” special handling for optional parameters
- Variable initialization values moved to their declaration
- Default properties resolution.
- Dead private methods removal
Structure / Library improvements
- Renaming conflicts and issues
- “Collections” transformed into “ArrayList” or “HashTable” based on their usage
- Unsupported statement/member handling