VBScript Terminators, Part Two

You guys came up with good answers to three of my four questions, which is about what I expected; question 2 was pretty hard. To sum up: QUESTION #1: Why does the termination logic go terminate, terminate, terminate, clear, clear, clear, instead of terminate and clear, terminate and clear, terminate and clear? Because if the…


T4: VBScript and the Terminator

I had some free time on the flight to Canada and my laptop with me, so maybe I will do a little blogging on my vacation after all. A week ago or so a reader asked me to talk a bit about how class termination works in VBScript.  Let’s start by looking at a simple…


The Cultural Politics of Code Reviews

For the last few weeks we’ve been doing a line-by-line code review of everything we’ve written in the last two years. We’re doing it in pairs, interestingly enough. There are many judgment calls to make when you do that kind of thing — on the one hand, you don’t want to touch working code and…


Whidbey Island And Bagel Mathematics

I was highly amused to read on Raymond Chen’s blog the other day that mathematicians are hard at work solving the problem of how to most evenly distribute poppyseeds over a bagel. The reason I was highly amused was not just the whimsical description of what is actually a quite practical and difficult problem. And…


Ologiology

No technology today — but, hey, where does that word “technology” come from, anyway? I’m on this politics/technology/etc. mailing list. A recent poster noted that Donald Rumsfeld, in an interview will Bill O’Reilly on the subject of, of all things, the Boy Scouts, used the word “phraseology”. He was speaking in reference to “don’t ask,…


VBScript Constants Are Not Hoisted

A reader asked me the other day to riff a bit on why this works: Dim iFor i = 1 To 2    print cNextConst c = 10 And this works For i = 1 To 2    print c    Dim iNextConst c = 10 but this fails with a “name redefined” error: For i = 1…


Why do built-in JScript functions not appear in the typeinfo?

A reader sent me an email over the weekend asking about some odd behaviour in the guts of the JScript engine.  Unfortunately, they didn’t include an email address that worked; I just got a bounce message back, Ben.  Therefore I’ll just answer the question here. To briefly describe the problem: the user fetches the JScript “Math”…


Integer Arithmetic in VBScript, Part Two

Here’s another recent question I’ve received on bit twiddling in VBScript: You discussed the issues with interpreting error results that come back interpreted as signed longs last year. Suppose we have a large unsigned long value, something like E18F4994. VBScript returns this value as -510703212. How can we go from this to the “representation” that…


Integer Arithmetic In VBScript, Part One

I’ve received some questions recently on how integer arithmetic works in VBScript, so I thought I might spend a few entries talking about some low-level bit twiddling topics. Here’s one of the mails I got this morning: There seems to be a limitation on the largest number that the VBScript “mod” operator works against. I…


Mexican Weddings, Medieval Warfare and Being Digital

I’m back! My Mexican soon-to-be-in-laws are fabulous hosts; we had a great time while we were there. Unfortunately, today I feel like I’ve been eating burritos for the last ten days. Unsurprisingly, they eat a lot of Mexican food in Mexico! I’m going to stay home from work today and eat soup.  Not how I wanted to celebrate…