A really cryptic and poor version of Microsoft's Visual Basic language. Mostly used within ASP (Active Server Pages). Only Microsoft's IIS web server supports any form of this bizzar and sickening language. A much better alternitive is PHP found at http://www.php.net

Quirks of VBScript
or More reasons VBScript is the work of the Devil

These are some of the annoying little inconsistencies which made me scream at the computer while learning VBScript. I've now been using VBScript for 3 years, and use it currently for my job. It's not a bad scripting language once you learn the quirks, but if you're coming from a real programming language background (C++, Java etc...) you'll hate it at first (and maybe forever).

If ... Then ... Else ... End If
a. Why Then? Four extra characters you have to type every time you write an If statement.
b. Logically, if the code is If ... End If, then wouldn't you expect an Else If statement to take the same form as the End If? It doesn't. It's one word - Elseif.

The While statement
Nearly every control statement in VBScript takes the form Command ... End Command. For example:

  • If ... End If
  • With ... End With
  • Select Case ... End Select
  • Function ... End Function
So logically, wouldn't it be While ... End While? Yes it would. But it isn't. It's While ... Wend. Why? Maybe they were trying to make up for having you type 4 extra characters in every If statement.

No ++ operator (or +=, -=, etc...)
Why leave out these easy to use and learn operators? Instead, you have to write variable = variable + 1 every damn time.

= is for equality AND assignment
This is just plain confusing.
'variable = 5' is an assignment, but 'If variable = 5 Then' is boolean logic and DOES NOT assign anything to variable.

Array indexing
In computer science, one of the first things you learn is that you count from 0, not from 1. For example, an array in Java declared so,

  int[] myArray = new int[10];
would be indexed from 0 to 9 (ex. myArray[5] gives you the 6th element of the array) for a total of 10 elements. Microsoft obviously assumed that no one using VBScript would be able to figure this out, and so in VBScript when you declare an array so,
  Dim myArray(10)
the 10 specifies the upper index of the array, not the size. So the VBScript myArray is actually an array of 11 elements, indexed 0 to 10. This might make sense if they indexed starting with 1, so that it was still an array of 10 elements, but as it is this just cries out for people to write bad code. Witness the quote below, from my professor in a Business Computing Technology course:
"The 0 index confuses me when I'm programming, so I don't use it and I recommend you don't either."
So here we have an entire class being encouraged to write code which eats needless memory, for convenience. Stuff like this makes baby jesus cry.

Log in or registerto write something here or to contact authors.