August 20, 2005

javascript > vbscript

Just thought I'd have a rant about vbscript, firstly let me spell it out:

vbscript sucks

Firstly, the language syntax is awful, let me explain:
1. No curly brackets, so you have to write code like:

if (someTest) then


end if

which not only takes longer but, I think is less clear.

2. There are no clear bitwise and logical operators, sure AND and OR exist, but vbscript decides when it wants to use these as bitwise, or logical operators, This in my view is a bad thing, every time you lose control of something as a programmer it should send a shiver up your spine. In javascript we have & and && or | and || respectively bitwise and logical and and or.

3. Subs and Functions, vbscript has this notion of a function that doesn't return anything, and calls it a sub, while javascript doesn't really care if you don't return a value from your function. While you may think subs are a good idea, you have to write silly code like this:

someSub firstParam,secondParam


call someSub(firstParam,secondParam)

thats right, if you use subs you can't use brackets when calling unless you use the special 'call' keyword, utterly stupid.

4. Compound operators, or lack thereof. In javscript I can write:

thisVal += 10;

but in vbscript I'm forced to do:

thisVal = thisVal + 10

I think the top one is much clearer, and this brings me neatly onto the next point,

5. Assignment and Equivalence, the operators for these two functions are the same in vbscript, =, but in javascript we have = and == respectively. How can i assign a value in a if staement in vb, I can't.

6. Too much english, IMHO, vbscript uses natural language too much, and while its a nice safety net, it looks plain ugly and makes it harder to read code.

If you must, learn to program using vbscript, but move quickly on to javascript or at least C syntax style languages. If you want learn a language thats has a slightly easier to pick up systax than C or java, try delphi, its way faster too.

- No comments Not publicly viewable

Add a comment

You are not allowed to comment on this entry as it has restricted commenting permissions.

August 2005

Mo Tu We Th Fr Sa Su
|  Today  | Sep
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31            

Search this blog


Not signed in
Sign in

Powered by BlogBuilder