Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ VBscript ➜ Question: option explicit

Question: option explicit

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by O-A2   Poland  (1 post)  Bio
Date Sun 23 Apr 2006 01:13 PM (UTC)
Message
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)
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #1 on Sun 23 Apr 2006 07:07 PM (UTC)
Message
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'.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


11,013 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.