Article 4CT26 Porting old posts, part 1

Porting old posts, part 1

by
ericlippert
from Fabulous adventures in coding on (#4CT26)

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.

External Content
Source RSS or Atom Feed
Feed Location http://ericlippert.com/feed
Feed Title Fabulous adventures in coding
Feed Link https://ericlippert.com/
Reply 0 comments