VBScript is Crap

I use VBScript all the time unfortunately. It’s pretty handy, and it’s easy for beginners to get into. But it’s getting old and is really slow for doing web stuff, and really isn’t as flexible as C-style languages (like JScript and the newer C# and stuff). I can forgive it things like ReDim for arrays (and insanely copying the entire array just to add elements onto the end of it…but I guess you need to allocate memory somehow), but what I just don’t get is this:

Function tmp(blah)
Response.Write(blah)
Response.Write blah
tmp = blah
End Function

Response.Write(tmp("blah"))
tmp "blah again"
If tmp("blah")="blah" Then Response.Write tmp("blah")
tmp("blah again")

The statement that will cause an error in that whole block is the last line! Don’t even think about putting brackets around a Function() or Sub() call if it’s not a built-in one like Response.Write()…UNLESS it’s part of another statement like a Response.Write or If…Then.

I just don’t get why they would do this.

Comment (1)

  1. Administrator wrote::

    That’s my point man, why should I have to put “Call” before the method call? It has me stuffed why this works — it should break because there is no ‘Call’ statement.

    Why does it sometimes force you to put “Call” before the function call and not others?

    So I think you missed my point, which was the inconsistency!

    Monday, October 3, 2005 at 7:40 pm #