Skip to main content

Posts

Showing posts from 2008

While and Comment Differences

I just thought I'd share what I thought about a couple of differences between JavaScript and VBScript.
Loop DifferenceI think it's better that JavaScript doesn't have a do...until loop. The do...until loop seems kind of superfluous to me, since the same can easily be accomplished with a while loop. For example, these two are equivalent:
Do Until (x) ' do something Loop while (!x) { // do something } Comments DifferenceNotice the difference between the comments in the examples above. That was the other difference I wanted to mention. I tend to think that faster is better, and it's faster to type the single quote (') than it is to type 2 forward slashes (//). On the other hand, JavaScript provides for making part of a line a comment anywhere in the code, like this:

if (x /* == true */)

As you can see, the end parenthesis ")" comes after the comment. I don't know if VBScript provides any way of making comments like that. Does anybody else know?