I had the privilege of heading over to Yahoos HQ’s URL’s Cafe to listen to Douglas Crockford give a history lesson on Javascript. Despite the lack of a personality and the very monotone presentational style, I found the information presented extremely interesting. This was the first in a series by Doug on “The Javascript Programming Language”. He’s previously done these sessions and didn’t expect the videos to be as popular as they turned out to be. This new series is an expansion and revamp of the old videos (you can find the videos on the YUI Blog).
The Early Years, 1801-1890
“The people who should be the first to recognize the value of an innovation are often the last and obsolete technologies fade away slowly.”
Throughout the session, Doug kept coming back to this idea. It started first with the Jacquard Loom in 1801. This mechanical loom was invented by Joseph Marie Jacquard, by adapting player piano technology with the rolling “script” to create a loom that would automatically create a design on a textile based on what it was given in the “scroll”. Rather than use this rolling script, Jacquard found it far easier to create “punchcards” that he would then sew together to create the design or pattern for which the loom would then create the textile from. Since automating this process increased productivity a hundredfold (or more), it started putting master weavers out of business, which caused great frustration. This beautiful invention also created the byproduct known as Industrial Sabotage by the sheer fact that these master weavers started trying to think of ways to destroy Jacquard’s loom.
It wasn’t until much later that the Jacquard Loom entered into mainstream textile weaving. This time frame seems to correlate with the passing of a generation of time — 20 years. More on this later. The Jacquard Loom plays an important part in the history of computing because it was the first machine to use punch cards to control the operation of “program”.
The next machine to take it another step further was the Hollerith Card Tabulating Machine of 1890. This simple machine was used during the 1890 Census to track the location and other information of U.S. citizens based on rows and columns of holes punched onto cards. The cards sat over pools of mercury that corresponded to the number of holes in the card. When wires were pressed down on the card, the wires that passed through a hole in the card dipped into the mercury, thereby completing the circuit and sounding a bell to let the operator know the card had been read. This complete circuit also allowed for a receptacle to open that corresponded to the information presented on the card. Compared to the Census of 1880, which took 7 years to complete, the Census of 1890 “…finished months ahead of schedule and far under budget.”
The Middle Years, 1950-1980
It wasn’t until the 1950s that this punch card technology started making its way into the corporate world to record data such as invoices, purchases, personnel, and any other record-keeping needs that a company would require. This introduced the idea of punch cards as we know them (or at least, have heard of) which eventually led to the Rise of the Mainframe, and the concept of the “Stored Program”. The Stored Program was a program that was “stored” on a set of cards and then ran through a machine that read the sequence of holes in order complete a task. Eventually, it wasn’t enough to just read one program, but we wanted to do things in “batch”, so we built machines that could handle multiple stacks of punch cards at a time, reading them into memory, and then processing the set of tasks. This again was a serious advancement in how things were done at the time — a significant hardware advancement. Programmers took time to catch on; about 20 years in fact.
Due the the lack of any organizational structure between the analyst writing the specs, the programmer coding the program, the keypuncher punching the program, the verifier checking the punches and the operator running the program, if a bug was discovered, a meeting would be called to find out how it was introduced.
The First Bug
As a sidenote, the first (recorded) bug was discovered by Thomas Edison:
Mr. Edison, I was informed, had been up the two previous nights discovering a bug in his phonograph.
– Pall Mall Gazette, 1889-03-11
This “bug” was probably some sort of chirp that sounded like a bug when he was listening to his phonograph. The idea of the “bug” was furthered along by Grace Hopper just after WWII while working on a Mark II Computer at Harvard. She and her associates found an actual moth stuck in a relay, which was causing issues with the computer. She then said something along the lines of needing to “debug” the system.
The Later Years, 1980-Present
As the need for computing power rose, so did the complexity of the architecture required to power these “behomoths”. This led to the introduction of the 8-bit generation of chips (Intel’s 8080, Zilog’s Z80, Motorola’s 6800 and MOS Technology’s 6502), which powered computers like the Apple II. These computers were considered breakthrough devices because it finally allowed the consumer (some would argue the prosumer) access to a computer, which was previously unattainable for people of the time. Computers exploded onto Main Street and many people still have fond memories of their Apple IIs and the programs they created on them. These 8-bit chips then gave way to their predecessor, 16-bit chips, which then gave way to Moore’s Law.
Moore’s Law (Hardware) and Programmers (Software)
Moore’s Law says that the number of transistors that can be placed inside a chip doubles approximately every two years. This law was named after Intel co-founder Gordon Moore and this “trend” has been continuing on for more than 50 years and isn’t expected to stop or slow down until 2015 or later. The reason this concept is important is due to the impact hardware improvements has on software improvements.
Generally speaking, hardware developers have a tendency to improve the quality and performance of their device with an efficiency along the same lines/path/trend as Moore’s Law “predicts”. They are incredibly efficient at building systems that use the best/most current technologies and work most efficiently.
Software developers, on the other hand, tend to be slower on the uptake than do hardware developers. As big of a game we talk, you would think that we’d be different, but we tend towards being “traditionalists” and not very forward-thinking. It takes about a generation of time (20ish years) for the ‘old hat’ ways to die off and allow the most current way of programming/building our application to come through.
This has been evidenced over and over throughout the history of hardware/software development, and is evidenced by Intel’s 8086 (and following) chip architecture. Intel developed the 8086 to be incredibly efficient and use the latest technology, but no one wanted it because it wasn’t backwards compatible with the 8080 architecture as well as costing more. Intel nearly collapsed because of this blunder and from the 8086 all the way through until after the Pentium chip has been based on the old 8080 chipset technology because we programmers don’t know (or want to learn) how to be progressive in our ways. Stuck in a rut we are.
Another example of this is with Procedural vs. Object-Oriented (OO) programming. For years and years and years, (software) developers thought the best way to program was in a procedural fashion. Only recently (within the last 5 years?) has OO programming become more mainstream.
Programming Languages
Once programmers started getting hardware that actually had the capacity (and ability) to handle “high-level” programming and weren’t stuck in building applications in Assembly Language (“low-level” programming), the number of languages at their disposal simply exploded. Fortran, COBOL and ALGOL all started building upon and stealing each other’s good ideas to create a language that was easy to read and understand.
Eventually, these three languages gave way to PL/I, CPL and ALGOL 68, which then gave way to BCPL and Pascal (finally a familiar name!). Fortran and BCPL finally gave way to B and B + Pascal = C, the root of every program and/or application.
You may be asking yourself at this point, what does all this have anything to do with Javascript’s history? I was in the same boat about this time as well. “You’re just going over the history of computers and programming languages! How does all this relate to Javascript’s history?” Douglas’ answer to my question came up in some of the next slides. There’s a lot more that he went over, but I’ll skip the slides that talk about how Smalltalk and C met, fell in love, and had 4 children (Objective C, C++, Eiffel, Ruby) and 2 grandchildren (C++ eloped with some unknown language. Java was the firstborn and then came along C#). I’m also not going to talk about the first ever game console because that would be another couple paragraphs, and I’m sure you (as I was) are starting to fade. I’ll say this though, the VCS was the first system that is credited with popularizing microprocessor-based hardware and cartridges (from which we get the rise of Nintendo, Sega, Sony and Xbox — they can all trace their roots back to the original Atari 2600).
The very basic root of Javascript can most likely be traced back to the original Macintosh computers and their simple, yet intuitive user-interface and a way of display information called “Hypercards” (sound familiar?). Hypercards were a simple way of displaying graphical information based on database entries that created a “user-modifiable interface”. Bundled with Hypercards was HyperText (sound familiar again?). HyperText drew upon the “user-friendliness of languages like SmallTalk (which was used in educational settings and looked very much like pseudo-code or even the Ruby programming language). HyperTalk used human-readable syntax to accomplish a set of tasks like click a button, enter text into a field, check a box and a few other items. Here’s the syntax:
on mouseUp
put "100,100" into pos
repeat with x = 1 to the number of card buttons
set the location of card button x to pos
add 15 to item 1 of pos
end repeat
end mouseUp
“Hey, that looks kinda like Javascript!” you might be saying. And you’d be right! “on mouseUp” got it’s start here in HyperTalk — pretty cool! From this idea of Hypercards and HyperTalk we also get Tim Berners-Lee’s idea of the WWW (sorry, not Al Gore’s idea), which leads to innovations like the Mosaic browser from whence we get Netscape and Spyglass (who is eventually purchased by Microsoft and becomes Internet Explorer). We have now entered the “Age of the browser” and we shall not return. Everything is different from here on out.
Javascript was written by Brendan Eich while at Netscape and its first version was written and deployed in just 10 days! Douglas challenged any language developer to build a language from the ground up in 10 days..heh. Brendan Eich relied heavily on languages such as Java, Scheme and Self to define Javascript and its syntax.
And that pretty much concluded the History of Javascript. Like I said at the beginning, not at all what I thought, but entirely interesting and informative.
What do you think P52ers?
UPDATE: If you are interested, here are some photos, full video and the slides.