tags:

views:

51

answers:

2

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
A: 

There are generally two reasons given for removing local variables.

  1. The program uses a little less memory, this is very minor and not the reason to remove the variables.
  2. 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