Porting old posts, part 1

Thanks again to the good people at Microsoft who have kept my old blog alive for now; my plan is to port the articles from the old site over, and then they will redirect from the old URLs to the new ones.

I’ve started the long process of porting old articles and it has been fun revisiting topics I haven’t thought about much for years.

I started this blog almost two years after I stopped working on scripting at Microsoft, but for the first several years, that’s almost all I posted about. The purpose of my blog was to get onto the web all the technical and design decisions we’d made about VBScript and JScript, and a lot of the details of my day job on Visual Studio Tools for Office did not translate well into the blog format.

IE is of course long gone, and now that Microsoft has switched to a Chromium-based browser for Edge, all of this stuff is now “for historical purposes only”; surely there are no developers left who need this information. Though that does make me slightly sad, I have to remember that software is plastic and we’re in the business of doing better than our past selves; sometimes that means starting afresh.

Anyways, as I port articles over I’ll post links to them here, with a few reflections.

Eric’s Complete Guide to BSTR Semantics
Eric’s Complete Guide to VT_DATE

My first posts, among the most popular of all time, and surprisingly still relevant.

Getting numerous links over the years from Raymond and others was a big help in kick-starting this blog. It’s also interesting in retrospect to realize that the standard format for allocating and deallocating strings in COM came from Visual Basic of all places; the B stands for “Basic”.

The VT_DATE format is horrid and should be destroyed by fire, but I think we’re still stuck with it.

What’s up with Hungarian Notation?
Bad Hungarian

The naming convention that everyone loves to hate is actually very useful if you use it correctly.

Why does JavaScript have rounding errors?

A classic FAQ that I got all the time when supporting the script engines.

As I update these articles, I’m going to try to use “JavaScript” to refer to the language proper, and “JScript” when I am speaking specifically about the Microsoft implementation from the mid 1990s.

Cannot use parentheses when calling a Sub
More on ByVal and ByRef
What are the VBScript semantics for object members?
Are JavaScript strings passed by value or by reference?
Are JavaScript strings passed by reference?

What does this error mean? It means that you cannot use parentheses when calling a sub! But boy, what a poor choice of syntax, that created so many questions.

The reason for the error is an oddity in the way that VBScript distinguishes between passing by value and passing by reference.

Understanding the difference between value semantics and reference semantics as they pertain to values, references and variables is a constant source of user questions. I wish we had done a better job early on of using “reference” to mean a reference to an object, and “alias” to mean a reference to a variable. But, we didn’t, and now we’re stuck with lots of beginner confusion.

That’s why this was a frequent topic in the early days of my blog, and came back again in the C# years.

This also marks the first of many quizzes and puzzles, to be answered in future episodes.

Smart pointers are too smart

The first really “controversial” post where I took a stand and wrote a rant. I stand by my opinion.

What are anonymous functions in JavaScript?
What are closures?

Functions without names, obviously. This is my first foray into writing about functional programming.

Why do the script engines not cache dispatch identifiers?
How do the script garbage collectors work?

These were the first posts where I really got into the implementation choices of a programming language.

This was also the first of many times I was told I was WRONG WRONG WRONG by Brendan Eich, the designer of JavaScript, later to be the CEO of Mozilla who stepped down after supporting anti-equality initiatives in California.

What are threading models?
How does ASP use the script engines?
Why is it a bad idea to put script objects in session scope?
Learnin’ about threadin’ the harrrrd way

The script engines use a wacky threading model, but it was built like that for reasons. However, if you use it wrong in ASP, you’ll quickly wreck the performance of your server as it tries to follow all the rules.

And if the developer of the components makes a boneheaded mistake, as I surely did, he learns all this stuff in a hurry.

Hard core denotational semantics

I discuss the highfalutin specification techniques used by the maintainers of the ECMAScript 4 specification; unfortunately, that version of the spec famously never shipped, and ECMAScript 5 went back to operational semantics.

13 thoughts on “Porting old posts, part 1

  1. Hey, it seems whatever you’re doing is actually spamming us with email notifications about these articles! I thought I was time traveling for a minute when I saw a new post notification about an article from 2003.

  2. “who stepped down after supporting anti-equality initiatives in California.”
    I feel like there is a JavaScript joke in there somewhere.

    • There might be!

      Coincidentally, for entirely unrelated reasons I just wrote a joke about JavaScript equality. I’m doing a presentation on the history of programming languages and I start off with a picture of Elrond saying “I was there Gandalf, three thousand years ago. I was there the day we added triple-equals to JavaScript“. (Though to be fair it was not me who actually committed the change; it was my colleague and later manager, Rok Yu.)

  3. As someone who found your blog a long time ago via one of Raymond’s links and then proceeded to read through your entire blog archives, this was a nice trip down memory lane :). I also want to say that this:

    > Though that does make me slightly sad, I have to remember that software is plastic and we’re in the business of doing better than our past selves; sometimes that means starting afresh.

    is just delightfully poignant.

    Speaking of old posts, this got me wondering if you ever posted a response to your original Comma Quibbling (https://blogs.msdn.microsoft.com/ericlippert/2009/04/15/comma-quibbling/) puzzle? (Now looking at that URL I realize it’s been almost 10 years (!) to the day since you posted that. Wow.)

    • Thanks for those kind words.

      You know, I don’t think I ever did! One of the embarrassing things about going through all my old posts is going to be revisiting the number of times I said I would follow up later and then never did. I’ve already found several examples of such, and I’ve only gone through the first couple weeks of posts! And I have certainly many times started large projects and then never finished them.

  4. I read through your archives last year while you were taking your “break” and they were most enjoyable. I actually went out and bought a JScript .NET book because of your early posts about it. I don’t expect to do anything major with it but I was curious how JavaScript got translated into IL and also as a primarily .NET developer I was very surprised that there was an entire .NET language from Microsoft that I’d never heard of.

    The thing I find most interesting about the design of programming languages is that everyone is asking the same questions but getting different answers. You’d figure it would be simple to come up with a definitive answer to “How do I declare a variable?” but if you look at modern programming languages there are still dozens of different ways to do it because of differences in context, purpose, ideals. You may design a feature one way for C# but completely differently for F# or Visual Basic. So having historical perspectives on why certain things were done the way they were is awesome.

    • Thanks, that means a lot to me; exploring that historical perspective is one of the main reasons why I do this blog.

      It is indeed sad that JS.NET never went anywhere. We put a lot of work into it. Oddly enough, the three developers who did the most work on it are all now at Facebook and one of them sits just a few desks away from me.

      We certainly do still see a lot of differences between languages; an aspect that I find particularly interesting is looking at the concepts which seem “fundamental”, and then discovering that they are not. The notion for instance that “variables can change their value” seemed completely fundamental to me when I was a self-taught BASIC programmer as a child; variables vary, it’s right there in the name. But I’ve helped build entire compilers where the vast, vast majority of variables were named values, assigned once and never changed. Similarly, we see OO programmers who think that classes are a fundamental concept to OO, but they are not. And so on.

  5. Pingback: Dew Drop – April 10, 2019 (#2935) | Morning Dew

  6. Nice to see the Hungarian notation articles again. If I remember rightly they were an influence on our in-house take, which tried to combine compliance with Microsoft’s .NET naming guidelines with a small set of prefixes that would improve code comprehension. I wrote about it here: https://ggreig.livejournal.com/116838.html

  7. Pingback: Porting old posts, part 2 | Fabulous adventures in coding

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s