I do know VBScript does not have method overloads or optional parameters, but some built in methods like InStr (and may others) can be called in different ways (e.g. InStr([start,] string1, string2 [, compare])).
Are they optional parameters or method overloads?
How are they possible?
What is the reason because the language can do this, but the developer not?
The InStr function has been a part of just about every incarnation of BASIC I can think of, including VBScript. I believe, it would have caused more trouble to remove it than to leave it there. Apart from this legacy, VBScript is aim at scripters, i.e. people who need to rapidly/simply perform a task. VBScript presents itself as a simply means to do so. I don't believe many would notice the absence of optional / default parameters.
One cool thing about VBScript is its integration to COM through CreateObject(). This means that any shortfall of VBScript can be overcome via creating code in a different language.
This, I believe, turns VBScript into a powerful tool for both VBScript scripters and developers. Scripters now have a limitless supply of objects that they can leverage from within their scripts, and developers now have a great unit testing platform for their COM objects.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With