Question: option explicit

Posted by O-A2 on Sun 23 Apr 2006 01:13 PM — 2 posts, 11,699 views.

Poland #0
Hi,
I'm using mush for about 2 weeks right now.

As I saw some of those sample scripts, I noticed that some of them either uses "option explict" or not.
So my question is: how does it affect the speed of script, what's the reason people use it (as additionaly you have to declare all variables)?

Even thought I read hundreds of posts, I haven't found any sense answer.
(I'm scripting in VBscript)
USA #1
It doesn't affect the speed of the scripts. It's useful to important good programming style. Being able to declare variables without meaning to do so can be dangerous especially for newer programmers (but also for veterans). Imagine you have a variable called score but then you type Score somewhere; that won't be the same variable in a case-sensitive language. Whenever I can I try to use option-explicit or its equivalent, which in Perl for example is 'use strict'.