Option explicit disadvantages

At any point in a program, you can use any variable name even if it has not been declared, and execution will continue by assigning the Variant data type to it. However, this is not good programming practice for the following reasons:

1. Memory & Calculation Speed: As the un-declared variable will have a variant data type, the variable takes up more memory than many of the other data types.

While a few extra bytes per variable might not seem to be a lot of memory, it is not uncommon for users to have thousands of variables in their programs. Therefore, the additional memory used to store Variants instead of Integers or Singles, can add up significantly.

2. Process time: Variant data types also take more time to process than some of the other data types, so if you have thousands of unnecessary Variant data types, this can slow down your calculations.

3. Prevention of 'Typo' Bugs: This will prevent you from introducing bugs into your code by accidentally typing a variable name incorrectly. For example, you might be using a variable called "sVAT_Rate" and, when assigning a value to this variable, you might accidentally type "VATRate = 0.175". From this point onwards, you are expecting your variable "sVAT_Rate" to have the value 0.l75, but of course it doesn't, because this value has been assigned to a different variable (the variable "VATRate"). However, if you were using the Option explicit option to force you to declare all variables before using them, this error would be highlighted by the compiler, as the variable "VATRate" would not have been declared.

4. Highlighting Unexpected Data Values: If you declare a variable to have a specific data type, and you attempt to assign the wrong type of data to it, this will generate an error in your program. While this may initially seem to be a good reason not to declare variables, you should think about this more carefully - you actually need to know as soon as possible if your variable receives an unexpected data type. Otherwise, if the program continues to run, you could end up with incorrect or unexpected results at a later time, when it is likely to be much more difficult to detect the causes of the errors.

Therefore, it is recommended that you always declare all variables when programming.