Hi, I have a code written in VB6. There I have some variable which can be removed by some code manipulation? Is there any advantage of removing one or two extra variables?
+4
A:
Instead of removing variables (how else do you refer to anything?) just reduce their scope.
Cidtek
2010-08-04 06:19:45
A:
There are generally two reasons given for removing local variables.
- The program uses a little less memory, this is very minor and not the reason to remove the variables.
- The code becomes a lot a clenaer, easier to read and a lot less complex. (This is the real reason to remove the variables).
Since (especially true with VB6) maintenance is where you spend 90% of your time programming, its worth making your life a little easier.
Kris Erickson
2010-08-04 15:09:11