Private Constants

At a minimum, it's a good idea to assign literal values to constants at the top of a module. Additionally, you should use the Private keyword in the declaration so that the constant can't be seen by other procedures outside the module. The main benefit of using constants in your code rather than one of the other methods listed is that constants give you the best performance.

You should consider using private constants when the constant value and name is unique to the given module and you don't want the value to be used by procedures in any other modules.

0 0

Post a comment