[thelist] [ASP] option explicit

Wade Armstrong wade_lists at runstrong.com
Mon Nov 18 10:57:01 CST 2002


on 11/18/02 7:16 AM, Feingold Josh S at Josh.S.Feingold at irs.gov wrote:
>> Do you guys use "option explicit" in you ASP files ?
>
> Usually not.
>
>> Why do/don't you use it ?
>
> I find that most of my ASP applications are not complicated enough to
> require option explicit.

In contrast, I find that it helps with even the simplest scripts. When I
fat-finger a variable name, for instance, strTxet when I mean strText,
rather than having my brand-new misspelled variable have the value of "",
which then takes some tracing within the code to fix, I have the line and
character number of my typo in an error message.

In large applications, you should be encapsulating everything in Functions
and Subs and Objects, making almost all of your variables private rather
than public. You shouldn't have that much trouble re-using variable names;
rather, your benefit here is from the faster execution you get with Option
Explicit.

Wade




More information about the thelist mailing list