, 53 tweets, 21 min read
A few nights ago I purchased some of the oldest JavaScript books I could find. This one is from March of 1996, less than a year after "Mocha" was written, and only a few months after the name "JavaScript" was chosen. I'm going to read it and share fun bits in this thread.
The very first page is a cut-out reference for common objects and their properties.

The first thing to catch my eye are the square brackets around the attributes for the script tag. WUT?

That old Netscape window is a sight for sore eyes. How I've missed it 🙂
"[the Web] has gotten so big that a whole new occupation has popped in the Sunday classifieds: Web Page Designer."

Do kids even know what the Sunday classifieds are these days? :)
"JavaScript is strictly for the World Wide Web" and not suitable for "creating a word processing program such as Microsoft Word."

JavaScript would become larger than anybody expected. Not only hopping off the Web, but actually being used to create Google Docs, and much more.
Long before the Browser Wars.

"…there is only one browser available that takes advantage of JavaScript's power: Netscape Navigator 2.0. … track down and install your very own copy of this nifty little program."
Well, actually, not very long before the browser wars. 1996 would be an intense year, with IE having been released in August of 1995.
I started web development about the time this book was written, and I have never done anything with CGI. JavaScript must have enabled me to bypass that opportunity 🙂
Image Maps (which many of us recall creating in HTML) had to be implemented with CGI. Marquees, which we all remember, were often done with Java. HTML rescued us from both; but then we rescued the Web from Image Maps and Marquees 😂
Chapter 1, complete. I learned something, which is nice. I was not aware that image maps were implemented with CGI originally, or that Marquees were done with Java.

Applets, in my experience, only ever made a rippling water effect for images on the Web in the 90s.

On to Part 2!
"In the future—perhaps by the time you read this—other browsers may also support JavaScript, such as Microsoft's Internet Explorer."

Time to learn how to setup Netscape Navigator 2.0!
"Netscape Navigator…is over 3 megabytes in size, so once you start the download, you might want to go get a cup of real coffee!"

I remember download a custom level to Jedi Knight: Dark Forces II that was 3MB in size. And if anyone picked up the receiver, fisticuffs.
Further down, "…it might be wise to keep [the file] around until you're confident that Netscape is working, just in case reinstallation is necessary. Wouldn't want to have to download that 3-megabyte file all over again."

I bet somebody picked up his receive a time or two 😂
Apparently a "self-extracting archive" was something of a surprise to users during this time. I had very little experience with computers before this time, so they were fairly normal for me. As far as I can remember.
"Netscape Navigator must assume that you have a properly configured Internet connection. It has no way of knowing this for itself."

"Most users of Windows 95 use Dial-Up Networking to create this connection…several online tutorials at windows95.com."
Such an unforgettable feature.

"Take note of the Netscape 'N' logo on the right side of the window…it indicates whether Netscape is currently retrieving data. If so, you will see the 'N' slightly animated… When no data is being retrieved, the icon sits still."
I spent entirely too much time making that last Tweet. I had to take the picture, upload it to IMGUR, find the Animated GIF, compose one over the other in an ad-hoc page, record with Screen to Gif (twice), and then optimize it like crazy to get from 30mb down to just over 5mb.
Chapter 3, complete. Looking at the first page of Chapter 4, I'm really curious about the last two bullet points: Handling "old" browsers, and JavaScript privacy. These statements meant something very different in 1996.
Earlier in this thread I expressed confusion over the use of square brackets around the language attribute. To my knowledge, this was not an optional attribute (until recently). The author addresses this in Chapter 4.
The previous owner of this book highlighted a couple things here. But what jumped out at me was the error in the second script tag, as well as the absence of a DOCTYPE on the code that followed. I can't recall what happened when I failed to include a doctype back in the day.
Okay, the very next page shows the same "mistake" in the SRC value. It looks like .js is a TLD to my 2019 senses, but maybe it worked differently then. No www, so perhaps the http://*.js was understood to be a resource on the same origin to be requested via HTTP. Anybody know?
Here's a struggle many have forgotten; It was necessary to wrap your script contents in an HTML comment to prevent them from being displayed as text on the page in browsers that didn't support JavaScript. @BrendanEich gave me some back-story 1.5 years ago or so; neat history.
@BrendanEich So, this is the bit about "JavaScript Privacy" I was anticipating, but it is not at all what I expected.

Want to prevent people from seeing your scripts? Don't type them in the HTML, place them in an external file.
@BrendanEich Time for Chapter 5. This page is heavy. Back in the 90s, "View Source" was the primary means by which I picked up new skills on the Web. It was my Stack Overflow, and my GitHub. Years ago there was chatter at Microsoft about removing (or burying) View Source; I wasn't in favor.
@BrendanEich "Netscape Navigator has been the most popular World Wide Web browser on the Internet to date, and with JavaScript, it's going to be in the forefront for some time to come."

This was written in March of 1996. By mid-late 1998, Internet Explorer had moved into the lead.
The book makes numerous references to the following URL (still available, thanks to the good folks at the @InternetArchive): web.archive.org/web/1997061321…
@internetarchive The reader is shown how to view the source for a given page, so as to study scripts found therein.

Notepad. That's what you got. No syntax-aware color-coding. No DOM objects with which to interact. No ability to fold func bodies, etc. We got black on white monospaced characters.
@internetarchive Alright, so I've made it to Chapter 6. So far it has all be quite meta, with no direct focus on the language itself. Looking forward to getting into JavaScript, as it existed in March of 1996.
@internetarchive So, this was a surprise.

While reading about types and primitives, I noted undefined was nowhere to be found. null was covered, but nothing on undefined.

A quick scan of ye old Web revealed that undefined came in JavaScript 1.3 (June 1997, more than a year later).
This evening I read the first 50 pages of this book from March of 1996. It's fun going back into these old resources, and remembering what the Web was like at that time. So much we take for granted today. There are about 200 pages remaining, so I'll pick things up tomorrow.
This section on object properties existing in the order in which they were defined sounded off.

for…in, Object.keys, etc. warn that properties are retrieved arbitrarily. Plus, this syntax no longer works:

({ size: 'M' })[0] // undefined

Not even in IE's emulation modes.
Well, this makes sense. If objects were "the same thing" as arrays, I can see how obj[0] made sense. Entries were enumerable, 'own' properties, and vise-versa.
Up until now, the book talks a lot about objects, without showing how to create one. They claim that property-order was reliable, and that you can interact with objects like you would an array (square bracket). Curious if I'm going to see an Object constructor, or { and }.
"In this chapter, you're going to look at methods of manipulating data, to generate new and improved—or at least useful—data. I guarantee this will be fun, or else you get a free video rental from your local video store down the street."

Playing operation? Video stores? So 1996.
Comparison operators! The book covers == and !=, but makes no mention of === or !==. The latter two didn't come until later. I don't believe typeof was available either, so I'm not sure how value and type were compared.
You don't see OR operators rendered as broken bars these days. Wikipedia states that earlier, low-res monitors may have preferred broken bars to distinguish them from uppercase i and lowercase L. Read more here: en.wikipedia.org/wiki/Vertical_…
On the final page the ternary operator makes an appearance, only it isn't called that. Instead, it is called a Conditional Expression. The 1.0 docs call it this as well. My PHP history may be to blame for my confusion.
That's the end of this chapter on operators and expressions. I believe bitwise operators existed at this time, but they don't appear in this book. Nothing on operator precedence either.
Reading about if…else statements and block formatting. The author states that "formatting…is purely a matter of taste." A timely admission, as the block formatting in this book continues to weird me out 😂
Earlier code examples in the book were careful to declare variables using the var keyword. Now they appear to have stopped. Also, no talk of scope at all (or collisions with other global properties).
This reference to 'prototypical object' made me wonder if there would be any talk of the internal [[Prototype]] property. I skipped ahead a bit, but didn't see anything. The NN 2.0 documentation also doesn't discuss it. But the ECMA-262 Standard mentioned it by June of 1997.
Ah, the infamous with statement. Neat, as it established a contextual object for proceeding statements. I assume its reputation went downhill pretty fast though. It is forbidden in ES5's strict mode.
On a side note, MDN still uses the same code examples from Netscape's site in 1996.
Ah, the author does indeed address the lack of var instances in their code. "…more a matter of style than necessity," they write. I disagree.

Years ago I wrote a small interview test which included `status = 'ok'`. This failed in IE, as it would collide with window.status.
While constructing our first function, the author does briefly stop to hint at scope and the potential to collide values unintentionally. So far, this is the only reference to scope in the entire book that I've seen. The book still downplays the importance of "Mother's advice."
There's a small note about 'top loading' your functions. This isn't required today, as Hoisting lifts declarations to the top of the enclosing scope.

foo('foo')

function foo (x) {
return x
}

Some consider this one of JavaScript's "weird" bits.
Hoisting was definitely supported by Netscape Navigator 2.01 (and likely earlier). I get the feeling this book is avoiding some of the more esoteric bits of the language 🙂
The section on Functions is nearly complete, and there are a couple things missing that I had hoped to see. First was something about the arguments object. Second, the Function's length property. As it turns out, arguments did not appear until later, but .length worked in NN2.01!
Another thing I didn't see was talk of using functions within functions, or returning one from another. This registers as a Syntax Error in Netscape Navigator 2.01.
Earlier in this thread I wondered if object creation would be done with literals, or Object. I forgot all about constructor functions. There wasn't any talk of the prototype though, so I played a bit to see what worked. Nothing worked 🙂 Prototypes were present though, it seems!
Only a subset of available events were covered in Ch. 10: Click, Focus, Blur, Change, MouseOver, Select, and Submit.

Not included were Load and Unload (these applied to BODY and FRAMESET tags).

Only event handler content attributes were supported.

Oh, and check out old Yahoo!
The Netscape Navigator 2.0 documentation for JavaScript at the time listed only 9 events. By comparison, I couldn't list all of today's events in a single Tweet. But here is a likely non-exhaustive list on MDN: developer.mozilla.org/en-US/docs/Web…. Events grew in numbers, and applicability.
On to Chapter 11! It sounds like most of the JavaScript parts are behind me, and now we will begin exploring global objects, and what they're capable of doing. To kick things off, a bit of window anatomy! window.status was the bee's knees back in the 90s.
Ah, the alert method. This is in the process of disappearing from modern projects. It blocks script execution while visible, is commonly abused by bad actors (preventing you from escaping pages) and more. Internet Explorer on Xbox stopped supporting alert and prompt years ago.
Missing some Tweet in this thread?
You can try to force a refresh.

Like this thread? Get email updates or save it to PDF!

Subscribe to Sampson
Profile picture

Get real-time email alerts when new unrolls are available from this author!

This content may be removed anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!