VBScript Quiz Answers, Part Four, Plus, More Trivia!

VBScript Quiz Answers, Part Four, Plus, More Trivia!

  • Comments 4

Last night I gave away more copies of my book at our Visual Studio Tools for Office developer lab, but this time I made the trivia questions a whole lot easier. I played five rounds of "Odd Man Out" -- you know, like from Sesame Street. One of these things is not like the other, one of these things just doesn't belong…

Just for fun, how many of them can you get?

A) Mort, Elvis, Einstein, Roger
B) WMI, ADO, DAO, ODBC
C) Gudgeon, Springlering, Pintle, Tumblehome
D) Frodo, Pippin, Bilbo, Drogo
E) Chicago, Daytona, Everett, Cairo

Spoiler warning: I'll put the answers in the comments to this post.

Pizza, beer, VSTO demos and dumb trivia questions -- it's a developer paradise over here, I tell you!

Anyway, moving swiftly on with the answers to my VBScript quiz:

4) Inside a class definition, which of the following are syntactically legal? Why?

(a) Private Default Sub Default()
(b) Public Default Function Default
(c) Public Default
(d) Public Default Property Get Default(Property)

(a) is illegal, the rest are legal.

(a) is illegal because it makes no sense to have a private default method.  The rest are legal because it is perfectly legal to use Default and Property as the names of member functions, properties and variables.

Why? We added the Default and Property keywords to the language in VBScript v5. We were afraid that we would break existing programs from a previous version if suddenly they became illegal to use as identifiers. If anyone happened to use Default or Property as a function or variable name, that needed to keep on working.  (And besides, VB6 doesn't reserve Default or Property either.)

We did have to make Class a reserved word. If Class is allowed as an identifier then you can get into this situation:

Sub Class(x)
End Sub
Class Foo


and it becomes very difficult to know whether you are calling the procedure or introducing a new class. Hopefully not very many people were using
Class as a variable name, because I broke all of them.

  • A: Mort, Elvis and Einstein are "persona" code names for Visual Studio users. Roger is not.

    B: ADO, DAO and ODBC are all data-access APIs. WMI is an administrative API, albeit one that uses data-management-style queries.

    C: Gudgeon, Pintle and Tumblehome are all parts of boats. The Springlering is the dance that the hobbits do at the party at the beginning of TLOTR:TFOTR.

    D: Frodo, Bilbo and Drogo are all Bagginses. Pippen is a Took. Alternate answer: Drogo is the only one who has no lines in TLOTR, because he's dead when the story begins. (Drogo is Frodo's father.)

    E: Chicago, Daytona and Cairo were code names for versions of Windows. Everett was the code name for the last version of Visual Studio and the CLR. Alternate answer: Cairo was the only one of those four that was cancelled.
  • Ah, the good old days of Chicago... when the whole OS was 40MB.
    Memphis (Win 98) was the best code name and the best easter egg (it involved finding both Memphis, Egypt and Memphis, TN on the world map).
  • For B, wouldn't it be fair to say that ADO, DAO and WMI belong together because they're COM-based, whereas ODBC is just a data access API?

    Oh, and D; is it Pipp*e*n in English? I think in the Swedish translation he's Pipp*i*n. But I've never read TLOTR, so I could very well be wrong. I didn't know about Drogo for sure :-)

    - Kim
  • Wasn't Daytona also the code name for SQL Server CE 2.0?
Page 1 of 1 (4 items)